private Set<String> expectedScopes(ProviderRequest request) { List<ScopeValidator.Scopes> expectedScopes = request.endpointConfig() .combineAnnotations(ScopeValidator.Scopes.class, EndpointConfig.AnnotationScope.values()); Set<String> result = new HashSet<>(); expectedScopes.stream() .map(ScopeValidator.Scopes::value) .map(Arrays::asList) .map(List::stream) .forEach(stream -> stream.map(ScopeValidator.Scope::value) .forEach(result::add)); return result; }
@Override protected AuthenticationResponse syncAuthenticate(ProviderRequest providerRequest) { if (!authenticate) { return AuthenticationResponse.abstain(); } List<LoginConfig> loginConfigs = providerRequest.endpointConfig() .combineAnnotations(LoginConfig.class, EndpointConfig.AnnotationScope.APPLICATION); try { return loginConfigs.stream() .filter(JwtAuthAnnotationAnalyzer::isMpJwt) .findFirst() .map(loginConfig -> authenticate(providerRequest, loginConfig)) .orElseGet(AuthenticationResponse::abstain); } catch (java.lang.SecurityException e) { return AuthenticationResponse.failed("Failed to process authentication header", e); } }
List<RuntimeAttribute> attributes = new ArrayList<>(); EndpointConfig epConfig = providerRequest.endpointConfig();
@Override protected AuthenticationResponse syncAuthenticate(ProviderRequest providerRequest) { if (!authenticate) { return AuthenticationResponse.abstain(); } List<LoginConfig> loginConfigs = providerRequest.endpointConfig() .combineAnnotations(LoginConfig.class, EndpointConfig.AnnotationScope.APPLICATION); try { return loginConfigs.stream() .filter(JwtAuthAnnotationAnalyzer::isMpJwt) .findFirst() .map(loginConfig -> authenticate(providerRequest, loginConfig)) .orElseGet(AuthenticationResponse::abstain); } catch (java.lang.SecurityException e) { return AuthenticationResponse.failed("Failed to process authentication header", e); } }
List<RuntimeAttribute> attributes = new ArrayList<>(); EndpointConfig epConfig = providerRequest.endpointConfig();