Пример #1
0
 @Test
 public void testIssuerInResults() throws Exception {
   tokenServices.setIssuer("http://some.other.issuer");
   tokenServices.afterPropertiesSet();
   accessToken = tokenServices.createAccessToken(authentication);
   Map<String, ?> result = endpoint.checkToken(accessToken.getValue());
   assertNotNull("iss field is not present", result.get("iss"));
   assertEquals("http://some.other.issuer/oauth/token", result.get("iss"));
 }
Пример #2
0
 @Test
 public void testIssuerInResultsInNonDefaultZone() throws Exception {
   try {
     IdentityZoneHolder.set(MultitenancyFixture.identityZone("id", "subdomain"));
     tokenServices.setIssuer("http://some.other.issuer");
     tokenServices.afterPropertiesSet();
     accessToken = tokenServices.createAccessToken(authentication);
     Map<String, ?> result = endpoint.checkToken(accessToken.getValue());
     assertNotNull("iss field is not present", result.get("iss"));
     assertEquals("http://subdomain.some.other.issuer/oauth/token", result.get("iss"));
   } finally {
     IdentityZoneHolder.clear();
   }
 }
Пример #3
0
 @Test(expected = InvalidTokenException.class)
 public void testRejectInvalidIssuer() {
   tokenServices.setIssuer("http://some.other.issuer");
   endpoint.checkToken(accessToken.getValue());
 }