0
Google Admin SDK 디렉토리 API를 살펴볼 예정입니다. 빠른 시작 가이드 또는 사용 가능한 자습서가 있습니까? 설명서가 Java 및 Python에 대한 빠른 시작 안내서는 있지만 .NET에는 없습니다. 큰 도움을 드리겠습니다.Google Admin SDK 디렉토리 API .Net 빠른 시작 가이드
Google Admin SDK 디렉토리 API를 살펴볼 예정입니다. 빠른 시작 가이드 또는 사용 가능한 자습서가 있습니까? 설명서가 Java 및 Python에 대한 빠른 시작 안내서는 있지만 .NET에는 없습니다. 큰 도움을 드리겠습니다.Google Admin SDK 디렉토리 API .Net 빠른 시작 가이드
첫 번째 단계는 도메인 전체 위임 권한이있는 서비스 계정을 갖는 것입니다. 아래 링크는 물론
String serviceAccountEmail = "[email protected]";
X509Certificate2 certificate = new X509Certificate2(@"C:\key.p12", "notasecret", X509KeyStorageFlags.Exportable);
ServiceAccountCredential credential = new ServiceAccountCredential(new ServiceAccountCredential.Initializer(serviceAccountEmail)
{
Scopes = new[]
{
DirectoryService.Scope.AdminDirectoryUser
},
User = "[email protected]"
}.FromCertificate(certificate));
var ser = new DirectoryService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = "Get it to work",
});
User newuserbody = new User();
UserName newusername = new UserName();
newuserbody.PrimaryEmail = "[email protected]";
newusername.GivenName = "jack";
newusername.FamilyName = "black";
newuserbody.Name = newusername;
newuserbody.Password = "password";
User results = ser.Users.Insert(newuserbody).Execute();
작동 "OAuth 클라이언트 액세스 관리"
https://developers.google.com/admin-sdk/directory/v1/guides/delegation
그것은 고급 설정에서 "관리 타사 OAuth 클라이언트 액세스"에 서비스 계정을 추가하는 말을하지만 난했다하는 방법을 보여줍니다