Exemplo n.º 1
0
 @Test
 public void testClientOnly() {
   authentication =
       new OAuth2Authentication(
           new AuthorizationRequest("client", Collections.singleton("scim.read"))
               .createOAuth2Request(),
           null);
   accessToken = tokenServices.createAccessToken(authentication);
   Claims result = endpoint.checkToken(accessToken.getValue());
   assertEquals("client", result.getClientId());
   assertEquals("client", result.getUserId());
 }
Exemplo n.º 2
0
 @Test
 public void testUserIdInResult() {
   Claims result = endpoint.checkToken(accessToken.getValue());
   assertEquals("olds", result.getUserName());
   assertEquals("12345", result.getUserId());
 }