org.zalando.stups.oauth2.spring.server.TokenInfoResourceServerTokenServices Java Examples

The following examples show how to use org.zalando.stups.oauth2.spring.server.TokenInfoResourceServerTokenServices. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OAuthConfiguration.java    From pazuzu-registry with MIT License 5 votes vote down vote up
@Bean
public ResourceServerTokenServices customResourceTokenServices() {
    return new TokenInfoResourceServerTokenServices("pazuzu-registry",
            new ClientIdAuthorityGrantingAuthenticationExtractor(registryProperties.getAdmins(), Roles.ADMIN),
            ExecutorWrappers
                    .wrap(new DefaultTokenInfoRequestExecutor(
                            accessTokensBeanProperties.getTokenInfoUri().toString())));
}
 
Example #2
Source File: AuthenticationConfig.java    From nakadi with MIT License 5 votes vote down vote up
@Bean
@Qualifier("remote")
public TokenInfoResourceServerTokenServices remoteTokenInfo(
        final RestTemplate restTemplate,
        final SecuritySettings securitySettings) {
    return new TokenInfoResourceServerTokenServices(
            securitySettings.getTokenInfoUrl(),
            securitySettings.getClientId(),
            new DefaultAuthenticationExtractor(),
            new DefaultUserRolesProvider(),
            restTemplate
    );
}
 
Example #3
Source File: AuthenticationConfig.java    From nakadi with MIT License 5 votes vote down vote up
@Bean
@Qualifier("local")
public TokenInfoResourceServerTokenServices localTokenInfo(
        final RestTemplate restTemplate,
        final SecuritySettings securitySettings) {
    return new TokenInfoResourceServerTokenServices(
            securitySettings.getLocalTokenInfoUrl(),
            securitySettings.getClientId(),
            new DefaultAuthenticationExtractor(),
            new DefaultUserRolesProvider(),
            restTemplate
    );
}
 
Example #4
Source File: AuthenticationConfig.java    From nakadi with MIT License 5 votes vote down vote up
@Bean
@Primary
public ResourceServerTokenServices zalandoResourceTokenServices(
        @Qualifier("remote") final TokenInfoResourceServerTokenServices remoteTokenInfo,
        @Qualifier("local") final TokenInfoResourceServerTokenServices localTokenInfo,
        final MetricRegistry metricRegistry,
        final FeatureToggleService featureToggleService) {
    return new NakadiResourceServerTokenServices(
            metricRegistry, localTokenInfo, remoteTokenInfo, featureToggleService);
}
 
Example #5
Source File: NakadiResourceServerTokenServices.java    From nakadi with MIT License 5 votes vote down vote up
public NakadiResourceServerTokenServices(
        final MetricRegistry metricRegistry,
        final TokenInfoResourceServerTokenServices localService,
        final TokenInfoResourceServerTokenServices remoteService,
        final FeatureToggleService featureToggleService) {
    this.remoteService = remoteService;
    this.localService = localService;
    this.timer = metricRegistry.timer(MetricUtils.NAKADI_PREFIX + "general.accessTokenValidation");
    this.featureToggleService = featureToggleService;
}