コード例 #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();
   }
 }