public async Task Passes_Token_Validation_With_CNAME() { // Arrange var authenticationApiClient = new AuthenticationApiClient(GetVariable("BRUCKE_AUTHENTICATION_API_URL")); // Act var authenticationResponse = await authenticationApiClient.GetTokenAsync(new ResourceOwnerTokenRequest { ClientId = GetVariable("BRUCKE_CLIENT_ID"), ClientSecret = GetVariable("BRUCKE_CLIENT_SECRET"), Realm = GetVariable("BRUCKE_CONNECTION_NAME"), Scope = "openid", Username = GetVariable("BRUCKE_USERNAME"), Password = GetVariable("BRUCKE_PASSWORD") }); var validator = new IdentityTokenValidator(); Func <Task> validationFunc = async() => await validator.ValidateInternal(authenticationResponse.IdToken, $"https://{GetVariable("BRUCKE_AUTHENTICATION_API_URL")}/", GetVariable("BRUCKE_CLIENT_ID")); // Assert authenticationResponse.IdToken.Should().NotBeNull(); validationFunc.Should().NotThrow <IdentityTokenValidationException>(); }
public async Task Passes_Token_Validation() { // Arrange var authenticationApiClient = new AuthenticationApiClient(GetVariable("AUTH0_AUTHENTICATION_API_URL")); // Act var authenticationResponse = await authenticationApiClient.GetTokenAsync(new ResourceOwnerTokenRequest { ClientId = GetVariable("AUTH0_CLIENT_ID"), ClientSecret = GetVariable("AUTH0_CLIENT_SECRET"), Realm = _connection.Name, Scope = "openid", Username = _user.Email, Password = Password }); var validator = new IdentityTokenValidator(); Func <Task> validationFunc = async() => await validator.ValidateInternal(authenticationResponse.IdToken, $"https://{GetVariable("AUTH0_AUTHENTICATION_API_URL")}/", GetVariable("AUTH0_CLIENT_ID")); // Assert authenticationResponse.IdToken.Should().NotBeNull(); validationFunc.Should().NotThrow <IdentityTokenValidationException>(); }