Search in sources :

Example 76 with ClientDetails

use of org.springframework.security.oauth2.provider.ClientDetails in project ORCID-Source by ORCID.

the class ClientDetailsManagerTest method testLoadClientByClientId.

@Test
@Rollback
@Transactional
public void testLoadClientByClientId() throws Exception {
    List<ClientDetailsEntity> all = clientDetailsManager.getAll();
    assertEquals(9, all.size());
    for (ClientDetailsEntity clientDetailsEntity : all) {
        ClientDetails clientDetails = clientDetailsManager.loadClientByClientId(clientDetailsEntity.getId());
        assertNotNull(clientDetails);
        if (!"APP-5555555555555555".equals(clientDetailsEntity.getId()) && !"APP-5555555555555556".equals(clientDetailsEntity.getId()) && !"APP-6666666666666666".equals(clientDetailsEntity.getId())) {
            checkClientDetails(clientDetails);
        }
    }
}
Also used : ClientDetailsEntity(org.orcid.persistence.jpa.entities.ClientDetailsEntity) ClientDetails(org.springframework.security.oauth2.provider.ClientDetails) DBUnitTest(org.orcid.test.DBUnitTest) Test(org.junit.Test) Rollback(org.springframework.test.annotation.Rollback) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

ClientDetails (org.springframework.security.oauth2.provider.ClientDetails)38 Test (org.junit.Test)34 BaseClientDetails (org.springframework.security.oauth2.provider.client.BaseClientDetails)28 OAuth2Authentication (org.springframework.security.oauth2.provider.OAuth2Authentication)23 ClientDetailsEntity (org.orcid.persistence.jpa.entities.ClientDetailsEntity)19 Authentication (org.springframework.security.core.Authentication)18 OAuth2Request (org.springframework.security.oauth2.provider.OAuth2Request)16 Date (java.util.Date)13 OAuth2AccessToken (org.springframework.security.oauth2.common.OAuth2AccessToken)13 HashMap (java.util.HashMap)11 ClientDetailsService (org.springframework.security.oauth2.provider.ClientDetailsService)7 ProfileEntity (org.orcid.persistence.jpa.entities.ProfileEntity)6 DBUnitTest (org.orcid.test.DBUnitTest)6 AnnotationConfigServletWebServerApplicationContext (org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext)6 OAuth2Exception (org.springframework.security.oauth2.common.exceptions.OAuth2Exception)6 AuthorizationRequest (org.springframework.security.oauth2.provider.AuthorizationRequest)6 TokenRequest (org.springframework.security.oauth2.provider.TokenRequest)6 OrcidOauth2ClientAuthentication (org.orcid.core.oauth.OrcidOauth2ClientAuthentication)5 DefaultOAuth2AccessToken (org.springframework.security.oauth2.common.DefaultOAuth2AccessToken)5 InvalidClientException (org.springframework.security.oauth2.common.exceptions.InvalidClientException)5