@Test public void shouldNotPermitIntrospectionToDifferentClientIfScopesDontMatch() { String authClient = "auth"; String tokenClient = "token"; Set<String> authScope = scope("scope1", "scope2"); Set<String> tokenScope = scope("scope1", "scope2", "scope3"); given(scopeService.scopesMatch(authScope, tokenScope)) .willReturn(false); boolean permitted = introspectionPermitter.isIntrospectionPermitted( clientWithIdAndScope(authClient, authScope), clientWithId(tokenClient), tokenScope); assertThat(permitted, is(false)); }
@Override public boolean isIntrospectionPermitted(ClientDetails authClient, ClientDetails tokenClient, Set<String> tokenScope) { return authClient.getClientId().equals(tokenClient.getClientId()) || scopeService.scopesMatch(authClient.getScope(), tokenScope); }
DefaultIntrospectionAuthorizer implements IntrospectionAuthorizer { @Override public boolean isIntrospectionPermitted(ClientDetails authClient, ClientDetails tokenClient, Set<String> tokenScope) { return authClient.getClientId().equals(tokenClient.getClientId()) || scopeService.scopesMatch(authClient.getScope(), tokenScope); } }
DefaultIntrospectionAuthorizer implements IntrospectionAuthorizer { @Override public boolean isIntrospectionPermitted(ClientDetails authClient, ClientDetails tokenClient, Set<String> tokenScope) { return authClient.getClientId().equals(tokenClient.getClientId()) || scopeService.scopesMatch(authClient.getScope(), tokenScope); }  }
DefaultIntrospectionAuthorizer implements IntrospectionAuthorizer { @Override public boolean isIntrospectionPermitted(ClientDetails authClient, ClientDetails tokenClient, Set<String> tokenScope) { return authClient.getClientId().equals(tokenClient.getClientId()) || scopeService.scopesMatch(authClient.getScope(), tokenScope); }  @Override boolean isIntrospectionPermitted(ClientDetails authClient,
			ClientDetails tokenClient, Set<String> tokenScope); }
DefaultIntrospectionAuthorizer implements IntrospectionAuthorizer { @Override public boolean isIntrospectionPermitted(ClientDetails authClient, ClientDetails tokenClient, Set<String> tokenScope) { return authClient.getClientId().equals(tokenClient.getClientId()) || scopeService.scopesMatch(authClient.getScope(), tokenScope); }  @Override boolean isIntrospectionPermitted(ClientDetails authClient,
			ClientDetails tokenClient, Set<String> tokenScope);  }