public async Task<AuthenticationResultProxy> AcquireTokenAsync(string resource, string clientId, UserCredentialProxy credential) { return await RunTaskAsync(this.context.AcquireTokenAsync(resource, clientId, (credential.Password == null) ? new UserCredential(credential.UserId) : new UserCredential(credential.UserId, credential.Password))); }
public static async Task MixedCaseUserNameTestAsync(Sts sts) { var context = new AuthenticationContextProxy(sts.Authority, sts.ValidateAuthority); UserCredentialProxy credential = new UserCredentialProxy(sts.ValidUserName3, sts.ValidPassword3); AuthenticationResultProxy result = await context.AcquireTokenAsync(sts.ValidResource, sts.ValidClientId, credential); VerifySuccessResult(sts, result); Verify.IsNotNull(result.UserInfo); Verify.AreNotEqual(result.UserInfo.DisplayableId, result.UserInfo.DisplayableId.ToLower()); AuthenticationContextProxy.Delay(2000); // 2 seconds delay AuthenticationResultProxy result2 = await context.AcquireTokenAsync(sts.ValidResource, sts.ValidClientId, credential); VerifySuccessResult(sts, result2); Verify.IsTrue(AreDateTimeOffsetsEqual(result.ExpiresOn, result2.ExpiresOn)); }
public static async Task AcquireTokenNonInteractivePositiveTestAsync(Sts sts) { var context = new AuthenticationContextProxy(sts.Authority, sts.ValidateAuthority); UserCredentialProxy credential = new UserCredentialProxy(sts.ValidUserName, sts.ValidPassword); AuthenticationResultProxy result = await context.AcquireTokenAsync(sts.ValidResource, sts.ValidClientId, credential); VerifySuccessResult(sts, result); Verify.IsNotNull(result.UserInfo); Verify.IsNotNullOrEmptyString(result.UserInfo.UniqueId); Verify.IsNotNullOrEmptyString(result.UserInfo.DisplayableId); AuthenticationContextProxy.Delay(2000); // Test token cache AuthenticationResultProxy result2 = await context.AcquireTokenAsync(sts.ValidResource, sts.ValidClientId, credential); VerifySuccessResult(sts, result2); VerifyExpiresOnAreEqual(result, result2); }
public async Task <AuthenticationResultProxy> AcquireTokenAsync(string resource, string clientId, UserCredentialProxy credential) { if (CallSync) { return(RunTask(() => this.context.AcquireToken(resource, clientId, (credential.Password == null) ? new UserCredential(credential.UserId) : new UserCredential(credential.UserId, credential.Password)))); } return(await RunTaskAsync(this.context.AcquireTokenAsync(resource, clientId, (credential.Password == null) ? new UserCredential(credential.UserId) : new UserCredential(credential.UserId, credential.Password)))); }
public async Task<AuthenticationResultProxy> AcquireTokenAsync(string resource, string clientId, UserCredentialProxy credential) { return await AddCommandAndRunAsync( CommandType.AquireTokenAsyncRCUPa, new CommandArguments { Resource = resource, ClientId = clientId, UserName = credential.UserId, Password = credential.Password }); }
public async Task<AuthenticationResultProxy> AcquireTokenAsync(string validResource, string validClientId, UserCredentialProxy credential) { return GetAuthenticationResultProxy(await this.context.AcquireTokenAsync(validResource, validClientId, new UserCredential(credential.UserId))); }
public async Task<AuthenticationResultProxy> AcquireTokenAsync(string validResource, string validClientId, UserCredentialProxy credential) { // Unsupported feature in ADAL.WinPhone throw new NotImplementedException(); }
public async Task <AuthenticationResultProxy> AcquireTokenAsync(string resource, string clientId, UserCredentialProxy credential) { return(await AddCommandAndRunAsync( CommandType.AquireTokenAsyncRCUPa, new CommandArguments { Resource = resource, ClientId = clientId, UserName = credential.UserId, Password = credential.Password })); }
public async Task <AuthenticationResultProxy> AcquireTokenAsync(string validResource, string validClientId, UserCredentialProxy credential) { // Unsupported feature in ADAL.WinPhone throw new NotImplementedException(); }
public async Task <AuthenticationResultProxy> AcquireTokenAsync(string validResource, string validClientId, UserCredentialProxy credential) { return(GetAuthenticationResultProxy(await this.context.AcquireTokenAsync(validResource, validClientId, new UserCredential(credential.UserId)))); }