Search in sources :

Example 11 with AbstractUaaEvent

use of org.cloudfoundry.identity.uaa.audit.event.AbstractUaaEvent in project uaa by cloudfoundry.

the class IdentityZoneEndpointsMockMvcTests method testDeleteZonePublishesEvent.

@Test
void testDeleteZonePublishesEvent() throws Exception {
    String id = generator.generate();
    IdentityZone zone = createZone(id, HttpStatus.CREATED, identityClientToken, new IdentityZoneConfiguration());
    uaaEventListener.clearEvents();
    ResultActions result = mockMvc.perform(delete("/identity-zones/{id}", zone.getId()).header("Authorization", "Bearer " + identityClientToken).accept(APPLICATION_JSON)).andExpect(status().isOk());
    IdentityZone deletedZone = JsonUtils.readValue(result.andReturn().getResponse().getContentAsString(), IdentityZone.class);
    assertEquals(Collections.EMPTY_MAP, deletedZone.getConfig().getTokenPolicy().getKeys());
    assertNull(deletedZone.getConfig().getSamlConfig().getPrivateKey());
    assertNull(deletedZone.getConfig().getSamlConfig().getPrivateKeyPassword());
    assertEquals(serviceProviderCertificate, deletedZone.getConfig().getSamlConfig().getCertificate());
    assertThat(uaaEventListener.getEventCount(), is(1));
    AbstractUaaEvent event = uaaEventListener.getLatestEvent();
    assertThat(event, instanceOf(EntityDeletedEvent.class));
    EntityDeletedEvent deletedEvent = (EntityDeletedEvent) event;
    assertThat(deletedEvent.getDeleted(), instanceOf(IdentityZone.class));
    deletedZone = (IdentityZone) deletedEvent.getDeleted();
    assertThat(deletedZone.getId(), is(id));
    assertThat(deletedEvent.getIdentityZoneId(), is(id));
    String auditedIdentityZone = deletedEvent.getAuditEvent().getData();
    assertThat(auditedIdentityZone, containsString(id));
}
Also used : AbstractUaaEvent(org.cloudfoundry.identity.uaa.audit.event.AbstractUaaEvent) Matchers.containsString(org.hamcrest.Matchers.containsString) ResultActions(org.springframework.test.web.servlet.ResultActions) EntityDeletedEvent(org.cloudfoundry.identity.uaa.audit.event.EntityDeletedEvent) KeyWithCertTest(org.cloudfoundry.identity.uaa.util.KeyWithCertTest) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 12 with AbstractUaaEvent

use of org.cloudfoundry.identity.uaa.audit.event.AbstractUaaEvent in project uaa by cloudfoundry.

the class TotpMfaEndpointTest method verifyMfaEvent.

private void verifyMfaEvent(Class<? extends AbstractUaaEvent> eventClass) {
    List<ApplicationEvent> values = eventCaptor.getAllValues();
    assertEquals(1, values.size());
    ApplicationEvent event = values.get(0);
    assertThat(event, instanceOf(eventClass));
    AbstractUaaEvent mfaEvent = (AbstractUaaEvent) event;
    assertEquals("google-authenticator", mfaEvent.getAuditEvent().getAuthenticationType());
}
Also used : ApplicationEvent(org.springframework.context.ApplicationEvent) AbstractUaaEvent(org.cloudfoundry.identity.uaa.audit.event.AbstractUaaEvent)

Example 13 with AbstractUaaEvent

use of org.cloudfoundry.identity.uaa.audit.event.AbstractUaaEvent in project uaa by cloudfoundry.

the class AuditCheckMockMvcTests method assertSingleClientAdminAuditEventFiredWith.

private void assertSingleClientAdminAuditEventFiredWith(AuditEventType expectedEventType, String[] expectedScopes, String[] expectedAuthorities) {
    List<AbstractUaaEvent> events = testListener.getEvents().stream().filter(e -> e instanceof AbstractClientAdminEvent).collect(Collectors.toList());
    assertNotNull(events);
    assertEquals(1, events.size());
    AbstractUaaEvent event = events.get(0);
    assertEquals(expectedEventType, event.getAuditEvent().getType());
    ArgumentCaptor<AuditEvent> captor = ArgumentCaptor.forClass(AuditEvent.class);
    verify(mockAuditService, atLeast(1)).log(captor.capture(), anyString());
    List<AuditEvent> auditEvents = captor.getAllValues().stream().filter(e -> e.getType() == expectedEventType).collect(Collectors.toList());
    assertNotNull(auditEvents);
    assertEquals(1, auditEvents.size());
    AuditEvent auditEvent = auditEvents.get(0);
    String auditEventData = auditEvent.getData();
    assertNotNull(auditEventData);
    Map<String, Object> map = JsonUtils.readValue(auditEventData, new TypeReference<Map<String, Object>>() {
    });
    List<String> auditScopes = (List<String>) map.get("scopes");
    List<String> auditAuthorities = (List<String>) map.get("authorities");
    assertNotNull(auditScopes);
    assertNotNull(auditAuthorities);
    assertThat(auditScopes, containsInAnyOrder(expectedScopes));
    assertThat(auditAuthorities, containsInAnyOrder(expectedAuthorities));
}
Also used : TokenIssuedEvent(org.cloudfoundry.identity.uaa.audit.event.TokenIssuedEvent) BeforeEach(org.junit.jupiter.api.BeforeEach) org.cloudfoundry.identity.uaa.test(org.cloudfoundry.identity.uaa.test) FilterChainProxy(org.springframework.security.web.FilterChainProxy) Autowired(org.springframework.beans.factory.annotation.Autowired) AuditListener(org.cloudfoundry.identity.uaa.audit.event.AuditListener) Base64(org.apache.commons.codec.binary.Base64) MockHttpServletRequestBuilder(org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder) OriginKeys(org.cloudfoundry.identity.uaa.constants.OriginKeys) ResultActions(org.springframework.test.web.servlet.ResultActions) Matcher(java.util.regex.Matcher) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) ConfigurableApplicationContext(org.springframework.context.ConfigurableApplicationContext) BaseClientDetails(org.springframework.security.oauth2.provider.client.BaseClientDetails) TypeReference(com.fasterxml.jackson.core.type.TypeReference) SecurityContextHolder(org.springframework.security.core.context.SecurityContextHolder) LostPasswordChangeRequest(org.cloudfoundry.identity.uaa.account.LostPasswordChangeRequest) HttpHeaders(org.springframework.http.HttpHeaders) MediaType(org.springframework.http.MediaType) WebApplicationContext(org.springframework.web.context.WebApplicationContext) ApplicationListener(org.springframework.context.ApplicationListener) MockHttpSession(org.springframework.mock.web.MockHttpSession) MockMvcResultMatchers(org.springframework.test.web.servlet.result.MockMvcResultMatchers) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) String.format(java.lang.String.format) Collectors.joining(java.util.stream.Collectors.joining) Matchers.startsWith(org.hamcrest.Matchers.startsWith) Test(org.junit.jupiter.api.Test) CookieCsrfPostProcessor.cookieCsrf(org.cloudfoundry.identity.uaa.mock.util.MockMvcUtils.CookieCsrfPostProcessor.cookieCsrf) DefaultTestContext(org.cloudfoundry.identity.uaa.DefaultTestContext) AuthzAuthenticationManager(org.cloudfoundry.identity.uaa.authentication.manager.AuthzAuthenticationManager) Stream(java.util.stream.Stream) RegexMatcher.matchesRegex(org.cloudfoundry.identity.uaa.integration.util.IntegrationTestUtils.RegexMatcher.matchesRegex) ApprovalModifiedEvent(org.cloudfoundry.identity.uaa.audit.event.ApprovalModifiedEvent) JsonUtils(org.cloudfoundry.identity.uaa.util.JsonUtils) Pattern(java.util.regex.Pattern) AuditEventType(org.cloudfoundry.identity.uaa.audit.AuditEventType) Base64Utils.encode(org.springframework.util.Base64Utils.encode) Authentication(org.springframework.security.core.Authentication) org.cloudfoundry.identity.uaa.audit(org.cloudfoundry.identity.uaa.audit) ClientDetails(org.springframework.security.oauth2.provider.ClientDetails) IdentityZoneManager(org.cloudfoundry.identity.uaa.zone.beans.IdentityZoneManager) PasswordChangeEvent(org.cloudfoundry.identity.uaa.account.event.PasswordChangeEvent) java.util(java.util) MessageDigest(java.security.MessageDigest) SimpleGrantedAuthority(org.springframework.security.core.authority.SimpleGrantedAuthority) MultitenantClientServices(org.cloudfoundry.identity.uaa.zone.MultitenantClientServices) UaaAuthenticationDetails(org.cloudfoundry.identity.uaa.authentication.UaaAuthenticationDetails) MockMvcUtils(org.cloudfoundry.identity.uaa.mock.util.MockMvcUtils) Nested(org.junit.jupiter.api.Nested) Utf8(org.springframework.security.crypto.codec.Utf8) JdbcTemplate(org.springframework.jdbc.core.JdbcTemplate) Value(org.springframework.beans.factory.annotation.Value) MockMvc(org.springframework.test.web.servlet.MockMvc) Lists(com.google.common.collect.Lists) ArgumentCaptor(org.mockito.ArgumentCaptor) MockMvcUtils.httpBearer(org.cloudfoundry.identity.uaa.mock.util.MockMvcUtils.httpBearer) MvcResult(org.springframework.test.web.servlet.MvcResult) MockMvcBuilders(org.springframework.test.web.servlet.setup.MockMvcBuilders) Qualifier(org.springframework.beans.factory.annotation.Qualifier) AbstractClientAdminEvent(org.cloudfoundry.identity.uaa.client.event.AbstractClientAdminEvent) Approval(org.cloudfoundry.identity.uaa.approval.Approval) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) org.cloudfoundry.identity.uaa.scim(org.cloudfoundry.identity.uaa.scim) Logger(org.slf4j.Logger) AbstractUaaEvent(org.cloudfoundry.identity.uaa.audit.event.AbstractUaaEvent) InterceptingLogger(org.cloudfoundry.identity.uaa.mock.util.InterceptingLogger) JdbcScimUserProvisioning(org.cloudfoundry.identity.uaa.scim.jdbc.JdbcScimUserProvisioning) Matchers(org.hamcrest.Matchers) APPLICATION_JSON_VALUE(org.springframework.http.MediaType.APPLICATION_JSON_VALUE) RandomValueStringGenerator(org.springframework.security.oauth2.common.util.RandomValueStringGenerator) MockMvcRequestBuilders(org.springframework.test.web.servlet.request.MockMvcRequestBuilders) UserModifiedEvent(org.cloudfoundry.identity.uaa.scim.event.UserModifiedEvent) ApplicationEvent(org.springframework.context.ApplicationEvent) Mockito(org.mockito.Mockito) AfterEach(org.junit.jupiter.api.AfterEach) org.cloudfoundry.identity.uaa.authentication.event(org.cloudfoundry.identity.uaa.authentication.event) ResetPasswordRequestEvent(org.cloudfoundry.identity.uaa.account.event.ResetPasswordRequestEvent) Assertions(org.junit.jupiter.api.Assertions) GroupModifiedEvent(org.cloudfoundry.identity.uaa.scim.event.GroupModifiedEvent) PasswordChangeFailureEvent(org.cloudfoundry.identity.uaa.account.event.PasswordChangeFailureEvent) StringUtils(org.springframework.util.StringUtils) AbstractClientAdminEvent(org.cloudfoundry.identity.uaa.client.event.AbstractClientAdminEvent) AbstractUaaEvent(org.cloudfoundry.identity.uaa.audit.event.AbstractUaaEvent)

Example 14 with AbstractUaaEvent

use of org.cloudfoundry.identity.uaa.audit.event.AbstractUaaEvent in project uaa by cloudfoundry.

the class ClientAdminEndpointsMockMvcTests method testClientCRUDAsAdminUser.

@Test
void testClientCRUDAsAdminUser() throws Exception {
    setupAdminUserToken();
    ClientDetails client = createClient(adminUserToken, SECRET, new RandomValueStringGenerator().generate(), Collections.singleton("client_credentials"));
    verify(mockApplicationEventPublisher, times(2)).publishEvent(abstractUaaEventCaptor.capture());
    for (AbstractUaaEvent event : abstractUaaEventCaptor.getAllValues()) {
        assertEquals(AuditEventType.ClientCreateSuccess, event.getAuditEvent().getType());
    }
    MockHttpServletRequestBuilder getClient = get("/oauth/clients/" + client.getClientId()).header("Authorization", "Bearer " + adminUserToken).accept(APPLICATION_JSON);
    MvcResult mvcResult = mockMvc.perform(getClient).andExpect(status().isOk()).andReturn();
    BaseClientDetails clientDetails = JsonUtils.readValue(mvcResult.getResponse().getContentAsString(), BaseClientDetails.class);
    assertEquals(client.getClientId(), clientDetails.getClientId());
    clientDetails.setAuthorizedGrantTypes(Collections.singleton(GRANT_TYPE_AUTHORIZATION_CODE));
    MockHttpServletRequestBuilder updateClient = put("/oauth/clients/" + client.getClientId()).header("Authorization", "Bearer" + adminUserToken).accept(APPLICATION_JSON).contentType(APPLICATION_JSON).content(JsonUtils.writeValueAsString(clientDetails));
    MvcResult result = mockMvc.perform(updateClient).andExpect(status().isOk()).andReturn();
    BaseClientDetails updatedClientDetails = JsonUtils.readValue(result.getResponse().getContentAsString(), BaseClientDetails.class);
    assertEquals(client.getClientId(), updatedClientDetails.getClientId());
    assertThat(updatedClientDetails.getAuthorizedGrantTypes(), PredicateMatcher.has(m -> m.equals(GRANT_TYPE_AUTHORIZATION_CODE)));
    MockHttpServletRequestBuilder deleteClient = delete("/oauth/clients/" + client.getClientId()).header("Authorization", "Bearer" + adminUserToken).accept(APPLICATION_JSON);
    MvcResult deleteResult = mockMvc.perform(deleteClient).andExpect(status().isOk()).andReturn();
    BaseClientDetails deletedClientDetails = JsonUtils.readValue(deleteResult.getResponse().getContentAsString(), BaseClientDetails.class);
    assertEquals(client.getClientId(), deletedClientDetails.getClientId());
}
Also used : BaseClientDetails(org.springframework.security.oauth2.provider.client.BaseClientDetails) BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) ClientDeleteEvent(org.cloudfoundry.identity.uaa.client.event.ClientDeleteEvent) Autowired(org.springframework.beans.factory.annotation.Autowired) SecretChangeRequest(org.cloudfoundry.identity.uaa.oauth.client.SecretChangeRequest) ResultActions(org.springframework.test.web.servlet.ResultActions) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) ClientUpdateEvent(org.cloudfoundry.identity.uaa.client.event.ClientUpdateEvent) Map(java.util.Map) ApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher) Is.is(org.hamcrest.core.Is.is) ClientApprovalsDeletedEvent(org.cloudfoundry.identity.uaa.client.event.ClientApprovalsDeletedEvent) ScimGroupMember(org.cloudfoundry.identity.uaa.scim.ScimGroupMember) GrantedAuthority(org.springframework.security.core.GrantedAuthority) SearchResults(org.cloudfoundry.identity.uaa.resources.SearchResults) DELETE(org.cloudfoundry.identity.uaa.oauth.client.SecretChangeRequest.ChangeMode.DELETE) Assert.assertFalse(org.junit.Assert.assertFalse) JsonUtils(org.cloudfoundry.identity.uaa.util.JsonUtils) Matchers.greaterThan(org.hamcrest.Matchers.greaterThan) AuditEventType(org.cloudfoundry.identity.uaa.audit.AuditEventType) InvalidClientDetailsException(org.cloudfoundry.identity.uaa.client.InvalidClientDetailsException) GRANT_TYPE_AUTHORIZATION_CODE(org.cloudfoundry.identity.uaa.oauth.token.TokenConstants.GRANT_TYPE_AUTHORIZATION_CODE) ClientDetails(org.springframework.security.oauth2.provider.ClientDetails) Mockito.mock(org.mockito.Mockito.mock) Iterables(com.google.common.collect.Iterables) UaaTestAccounts(org.cloudfoundry.identity.uaa.test.UaaTestAccounts) Nested(org.junit.jupiter.api.Nested) MockHttpServletResponse(org.springframework.mock.web.MockHttpServletResponse) ArrayList(java.util.ArrayList) ScimGroup(org.cloudfoundry.identity.uaa.scim.ScimGroup) ZoneSeederExtension(org.cloudfoundry.identity.uaa.test.ZoneSeederExtension) Value(org.springframework.beans.factory.annotation.Value) MockMvc(org.springframework.test.web.servlet.MockMvc) Strings(com.google.common.base.Strings) MockMvcRequestBuilders.delete(org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete) MockMvcResultMatchers.status(org.springframework.test.web.servlet.result.MockMvcResultMatchers.status) MockMvcUtils.httpBearer(org.cloudfoundry.identity.uaa.mock.util.MockMvcUtils.httpBearer) MockMvcRequestBuilders.post(org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post) TestClient(org.cloudfoundry.identity.uaa.test.TestClient) MvcResult(org.springframework.test.web.servlet.MvcResult) Matchers.hasSize(org.hamcrest.Matchers.hasSize) Approval(org.cloudfoundry.identity.uaa.approval.Approval) LinkedHashSet(java.util.LinkedHashSet) ClientDetailsHelper.clientArrayFromString(org.cloudfoundry.identity.uaa.mock.util.ClientDetailsHelper.clientArrayFromString) UaaScopes(org.cloudfoundry.identity.uaa.client.UaaScopes) ScimUser(org.cloudfoundry.identity.uaa.scim.ScimUser) SecretChangeEvent(org.cloudfoundry.identity.uaa.client.event.SecretChangeEvent) Assert.assertTrue(org.junit.Assert.assertTrue) Mockito.times(org.mockito.Mockito.times) UaaException(org.cloudfoundry.identity.uaa.error.UaaException) RandomValueStringGenerator(org.springframework.security.oauth2.common.util.RandomValueStringGenerator) PredicateMatcher(org.cloudfoundry.identity.uaa.util.PredicateMatcher) HttpStatus(org.springframework.http.HttpStatus) AfterEach(org.junit.jupiter.api.AfterEach) Assert.assertNull(org.junit.Assert.assertNull) MockMvcRequestBuilders.get(org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get) ClientSecretPolicy(org.cloudfoundry.identity.uaa.zone.ClientSecretPolicy) AuthorityUtils(org.springframework.security.core.authority.AuthorityUtils) Assert.assertEquals(org.junit.Assert.assertEquals) Date(java.util.Date) SecretFailureEvent(org.cloudfoundry.identity.uaa.client.event.SecretFailureEvent) MockHttpServletRequestBuilder(org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder) IdentityZoneHolder(org.cloudfoundry.identity.uaa.zone.IdentityZoneHolder) Assert.assertThat(org.junit.Assert.assertThat) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) BaseClientDetails(org.springframework.security.oauth2.provider.client.BaseClientDetails) TypeReference(com.fasterxml.jackson.core.type.TypeReference) MockMvcRequestBuilders.put(org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put) Collection(java.util.Collection) WebApplicationContext(org.springframework.web.context.WebApplicationContext) ScimUserEndpoints(org.cloudfoundry.identity.uaa.scim.endpoints.ScimUserEndpoints) ADD(org.cloudfoundry.identity.uaa.oauth.client.SecretChangeRequest.ChangeMode.ADD) ZoneSeeder(org.cloudfoundry.identity.uaa.test.ZoneSeeder) Test(org.junit.jupiter.api.Test) DefaultTestContext(org.cloudfoundry.identity.uaa.DefaultTestContext) List(java.util.List) ClientAdminEventPublisher(org.cloudfoundry.identity.uaa.client.event.ClientAdminEventPublisher) ClientDetailsModification(org.cloudfoundry.identity.uaa.oauth.client.ClientDetailsModification) HashMap(java.util.HashMap) ClientMetadata(org.cloudfoundry.identity.uaa.client.ClientMetadata) MockMvcUtils(org.cloudfoundry.identity.uaa.mock.util.MockMvcUtils) MockMvcResultMatchers.content(org.springframework.test.web.servlet.result.MockMvcResultMatchers.content) ScimGroupEndpoints(org.cloudfoundry.identity.uaa.scim.endpoints.ScimGroupEndpoints) ArgumentCaptor(org.mockito.ArgumentCaptor) ClientCreateEvent(org.cloudfoundry.identity.uaa.client.event.ClientCreateEvent) Matchers.iterableWithSize(org.hamcrest.Matchers.iterableWithSize) Qualifier(org.springframework.beans.factory.annotation.Qualifier) APPLICATION_JSON(org.springframework.http.MediaType.APPLICATION_JSON) Matchers.hasEntry(org.hamcrest.Matchers.hasEntry) JdbcApprovalStore(org.cloudfoundry.identity.uaa.approval.JdbcApprovalStore) AbstractUaaEvent(org.cloudfoundry.identity.uaa.audit.event.AbstractUaaEvent) Assert.assertNotNull(org.junit.Assert.assertNotNull) HttpServletResponse(javax.servlet.http.HttpServletResponse) ApprovalStatus(org.cloudfoundry.identity.uaa.approval.Approval.ApprovalStatus) Mockito.verify(org.mockito.Mockito.verify) ActionResult(org.cloudfoundry.identity.uaa.resources.ActionResult) GRANT_TYPE_JWT_BEARER(org.cloudfoundry.identity.uaa.oauth.token.TokenConstants.GRANT_TYPE_JWT_BEARER) ClientDetailsHelper.arrayFromString(org.cloudfoundry.identity.uaa.mock.util.ClientDetailsHelper.arrayFromString) ClientDetailsHelper.clientFromString(org.cloudfoundry.identity.uaa.mock.util.ClientDetailsHelper.clientFromString) Collections(java.util.Collections) StringUtils(org.springframework.util.StringUtils) ClientDetails(org.springframework.security.oauth2.provider.ClientDetails) BaseClientDetails(org.springframework.security.oauth2.provider.client.BaseClientDetails) MockHttpServletRequestBuilder(org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder) AbstractUaaEvent(org.cloudfoundry.identity.uaa.audit.event.AbstractUaaEvent) RandomValueStringGenerator(org.springframework.security.oauth2.common.util.RandomValueStringGenerator) MvcResult(org.springframework.test.web.servlet.MvcResult) Test(org.junit.jupiter.api.Test)

Example 15 with AbstractUaaEvent

use of org.cloudfoundry.identity.uaa.audit.event.AbstractUaaEvent in project uaa by cloudfoundry.

the class TotpMfaEndpointMockMvcTests method setup.

@BeforeEach
void setup(@Autowired TestClient testClient, @Autowired ConfigurableApplicationContext configurableApplicationContext, @Autowired ScimUserProvisioning scimUserProvisioning) throws Exception {
    adminToken = testClient.getClientCredentialsOAuthAccessToken("admin", "adminsecret", "clients.read clients.write clients.secret clients.admin uaa.admin");
    mfaProvider = createMfaProvider(webApplicationContext, IdentityZone.getUaa());
    otherMfaProvider = createMfaProvider(webApplicationContext, IdentityZone.getUaa());
    uaaZoneConfig = MockMvcUtils.getZoneConfiguration(webApplicationContext, IdentityZone.getUaaZoneId());
    uaaZoneConfig.getMfaConfig().setEnabled(true).setProviderName(mfaProvider.getName());
    MockMvcUtils.setZoneConfiguration(webApplicationContext, IdentityZone.getUaaZoneId(), uaaZoneConfig);
    // noinspection unchecked
    applicationListener = (ApplicationListener<AbstractUaaEvent>) mock(ApplicationListener.class);
    configurableApplicationContext.addApplicationListener(applicationListener);
    password = "sec3Tas";
    scimUser = createUser(scimUserProvisioning, password);
    mockHttpSession = new MockHttpSession();
}
Also used : AbstractUaaEvent(org.cloudfoundry.identity.uaa.audit.event.AbstractUaaEvent) MockHttpSession(org.springframework.mock.web.MockHttpSession) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

AbstractUaaEvent (org.cloudfoundry.identity.uaa.audit.event.AbstractUaaEvent)17 Test (org.junit.jupiter.api.Test)14 ResultActions (org.springframework.test.web.servlet.ResultActions)8 MockHttpServletRequestBuilder (org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder)8 ClientDetails (org.springframework.security.oauth2.provider.ClientDetails)6 BaseClientDetails (org.springframework.security.oauth2.provider.client.BaseClientDetails)6 MockHttpSession (org.springframework.mock.web.MockHttpSession)5 BeforeEach (org.junit.jupiter.api.BeforeEach)4 MfaAuthenticationSuccessEvent (org.cloudfoundry.identity.uaa.authentication.event.MfaAuthenticationSuccessEvent)3 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)3 RandomValueStringGenerator (org.springframework.security.oauth2.common.util.RandomValueStringGenerator)3 MockMvcResultHandlers.print (org.springframework.test.web.servlet.result.MockMvcResultHandlers.print)3 TypeReference (com.fasterxml.jackson.core.type.TypeReference)2 DefaultTestContext (org.cloudfoundry.identity.uaa.DefaultTestContext)2 Approval (org.cloudfoundry.identity.uaa.approval.Approval)2 AuditEventType (org.cloudfoundry.identity.uaa.audit.AuditEventType)2 IdentityProviderAuthenticationFailureEvent (org.cloudfoundry.identity.uaa.authentication.event.IdentityProviderAuthenticationFailureEvent)2 InterceptingLogger (org.cloudfoundry.identity.uaa.mock.util.InterceptingLogger)2 MockMvcUtils (org.cloudfoundry.identity.uaa.mock.util.MockMvcUtils)2 MockMvcUtils.httpBearer (org.cloudfoundry.identity.uaa.mock.util.MockMvcUtils.httpBearer)2