コード例 #1
0
        private bool CreateUser(AzureADGraphClient azureADGraphClient,
                                PeopleSoftInputClaimsModel inputClaims)
        {
            //AzureADGraphClient azureADGraphClient = new AzureADGraphClient(this.AppSettings.Tenant, this.AppSettings.ClientId, this.AppSettings.ClientSecret);

            // Create the user using Graph API
            return(azureADGraphClient.CreateAccount(
                       "userName",
                       inputClaims.uid,
                       null,
                       null,
                       inputClaims.email,
                       inputClaims.password,
                       inputClaims.sn,
                       inputClaims.email,
                       inputClaims.givenname).Result);
        }
コード例 #2
0
        private async Task MigrateUser(InputClaimsModel inputClaims, CloudTable table, TableResult userMigrationEntity)
        {
            AzureADGraphClient azureADGraphClient = new AzureADGraphClient(this.AppSettings.Tenant, this.AppSettings.ClientId, this.AppSettings.ClientSecret);

            // Create the user using Graph API
            await azureADGraphClient.CreateAccount(
                "emailAddress",
                inputClaims.signInName,
                null,
                null,
                null,
                inputClaims.password,
                ((UserTableEntity)userMigrationEntity.Result).DisplayName,
                ((UserTableEntity)userMigrationEntity.Result).FirstName,
                ((UserTableEntity)userMigrationEntity.Result).LastName);

            // Remove the user entity from migration table
            TableOperation deleteOperation = TableOperation.Delete((UserTableEntity)userMigrationEntity.Result);
            await table.ExecuteAsync(deleteOperation);
        }