use of oidc.repository.OpenIDClientRepository in project OpenConext-oidcng by OpenConext.
the class AuthorizationEndpointUnitTest method doValidateScope.
@SuppressWarnings("unchecked")
private void doValidateScope(String clientScope, String requestResponseScope) throws IOException, ParseException {
AuthorizationRequest authorizationRequest = authorizationRequest(new FluentMap<String, String>().p("client_id", "http://oidc-rp").p("response_type", "code").p("scope", requestResponseScope));
OpenIDClient client = openIDClient("http://redirect", clientScope, "authorization_code");
OpenIDClientRepository openIDClientRepository = mock(OpenIDClientRepository.class);
when(openIDClientRepository.findByClientIdIn(null)).thenReturn(Collections.singletonList(openIDClient("http://redirect", clientScope, "authorization_code")));
List<String> scopes = AuthorizationEndpoint.validateScopes(openIDClientRepository, new Scope(requestResponseScope), client);
assertEquals(singletonList(requestResponseScope), scopes);
}
Aggregations