• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CompositeTokenGranter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.springframework.security.oauth2.provider.CompositeTokenGranter的典型用法代码示例。如果您正苦于以下问题:Java CompositeTokenGranter类的具体用法?Java CompositeTokenGranter怎么用?Java CompositeTokenGranter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CompositeTokenGranter类属于org.springframework.security.oauth2.provider包,在下文中一共展示了CompositeTokenGranter类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: configure

import org.springframework.security.oauth2.provider.CompositeTokenGranter; //导入依赖的package包/类
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints)
    throws Exception {
  endpoints.tokenStore(tokenStore())
      .tokenEnhancer(jwtTokenEnhancer())
      .authenticationManager(authenticationManager)
      .userDetailsService(userDetailsService);

  List<TokenGranter> tokenGranters = new ArrayList<>();
  tokenGranters
      .add(new CustomResourceOwnerPasswordTokenGranter(authenticationManager,
          endpoints.getTokenServices(), endpoints.getClientDetailsService(),
          endpoints.getOAuth2RequestFactory()));
  tokenGranters.add(new RefreshTokenGranter(endpoints.getTokenServices(),
      endpoints.getClientDetailsService(),
      endpoints.getOAuth2RequestFactory()));
  endpoints.tokenGranter(new CompositeTokenGranter(tokenGranters));
}
 
开发者ID:gdong42,项目名称:spring-auth-example,代码行数:19,代码来源:OAuth2Config.java


示例2: configure

import org.springframework.security.oauth2.provider.CompositeTokenGranter; //导入依赖的package包/类
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
    DefaultOAuth2RequestFactory requestFactory = new DefaultOAuth2RequestFactory(clientDetailsService);

    endpoints
            .tokenStore(tokenStore)
            .authenticationManager(authenticationManager)
            .tokenServices(authorizationServerTokenServices)
            .requestFactory(requestFactory)
            .tokenEnhancer(tokenEnhancer)
            .tokenGranter(
                    new CompositeTokenGranter(Arrays.asList(
                            new ResourceOwnerPasswordTokenGranter(
                                    authenticationManager,
                                    authorizationServerTokenServices,
                                    clientDetailsService,
                                    requestFactory
                            ),
                            new RefreshTokenGranter(
                                    authorizationServerTokenServices,
                                    clientDetailsService,
                                    requestFactory)
                    ))
            )
    ;
}
 
开发者ID:sys-devel-d,项目名称:pimp,代码行数:27,代码来源:OAuthConfig.java


示例3: tokenGranter

import org.springframework.security.oauth2.provider.CompositeTokenGranter; //导入依赖的package包/类
@Bean
public TokenGranter tokenGranter() throws Exception {
    return new CompositeTokenGranter(Arrays.asList(new TokenGranter[]{
            new ClientCredentialsTokenGranter(
                    tokenServices(), osiamClientDetailsService, oAuth2RequestFactory()
            ),
            new OsiamResourceOwnerPasswordTokenGranter(
                    authenticationManager, tokenServices(), osiamClientDetailsService, oAuth2RequestFactory()
            ),
            new RefreshTokenGranter(
                    tokenServices(), osiamClientDetailsService, oAuth2RequestFactory()
            ),
            new LessStrictRedirectUriAuthorizationCodeTokenGranter(
                    tokenServices(), authorizationCodeServices(), osiamClientDetailsService, oAuth2RequestFactory()
            )
    }));
}
 
开发者ID:osiam,项目名称:auth-server,代码行数:18,代码来源:OAuth2AuthorizationServerConfig.java


示例4: tokenGranter

import org.springframework.security.oauth2.provider.CompositeTokenGranter; //导入依赖的package包/类
@Bean
public TokenGranter tokenGranter() {

    DefaultOAuth2RequestFactory requestFactory = new DefaultOAuth2RequestFactory(clientDetailsService());

    AuthorizationCodeServices codeServices = authorizationCodeServices();

    AuthorizationServerTokenServices tokenServices = tokenServices();
    List<TokenGranter> tokenGranters = Arrays.asList(
            new CustomAuthCodeTokenGranter(tokenServices, codeServices, clientDetailsService(), requestFactory),
            new ResourceOwnerPasswordTokenGranter(authenticationManager, tokenServices, clientDetailsService(), requestFactory),
            new ImplicitTokenGranter(tokenServices, clientDetailsService(), requestFactory));

    return new CompositeTokenGranter(tokenGranters);
}
 
开发者ID:PacktPublishing,项目名称:OAuth-2.0-Cookbook,代码行数:16,代码来源:OAuth2Configuration.java


示例5: compositeTokenGranter

import org.springframework.security.oauth2.provider.CompositeTokenGranter; //导入依赖的package包/类
private TokenGranter compositeTokenGranter(AuthorizationServerEndpointsConfigurer endpoints) {
    TokenGranter mobileIdTokenGranter = mobileIdTokenGranter(endpoints);
    TokenGranter idCardTokenGranter = idCardTokenGranter(endpoints);
    TokenGranter refreshTokenGranter = new RefreshTokenGranter(
      endpoints.getTokenServices(), clientDetailsService(), endpoints.getOAuth2RequestFactory());
    TokenGranter clientCredentialsTokenGranter =
            new ClientCredentialsTokenGranter(
                    endpoints.getTokenServices(), clientDetailsService(), endpoints.getOAuth2RequestFactory());

    return new CompositeTokenGranter(asList(mobileIdTokenGranter, idCardTokenGranter,
      refreshTokenGranter, clientCredentialsTokenGranter));
}
 
开发者ID:TulevaEE,项目名称:onboarding-service,代码行数:13,代码来源:OAuthConfiguration.java


示例6: configure

import org.springframework.security.oauth2.provider.CompositeTokenGranter; //导入依赖的package包/类
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
    endpoints.authenticationManager(authenticationManager)//for password grant type to load user info
            .authorizationCodeServices(authorizationCodeServices())//for AuthorizationEndPoint to create code
            .tokenGranter(new CompositeTokenGranter(getCustomizedTokenGranters()))//custom token granters
            .tokenServices(tokenServices())//for refresh_token grant type, setSupportRefreshToken to be true
            .approvalStore(approvalStore());
}
 
开发者ID:openmg,项目名称:metagraph-auth,代码行数:9,代码来源:AuthorizationServerConfigurer.java


示例7: tokenGranter

import org.springframework.security.oauth2.provider.CompositeTokenGranter; //导入依赖的package包/类
@Bean
TokenGranter tokenGranter() {
    List<TokenGranter> tokenGranters = Lists.newArrayList();
    ResourceOwnerPasswordTokenGranter resourceOwnerPasswordTokenGranter = new ResourceOwnerPasswordTokenGranter(am,getDefaultTokenServices()
    ,getClientDetailsService(),new DefaultOAuth2RequestFactory(getClientDetailsService()));
    ClientCredentialsTokenGranter clientCredentialsTokenGranter = new ClientCredentialsTokenGranter(getDefaultTokenServices(),getClientDetailsService(),new DefaultOAuth2RequestFactory(getClientDetailsService()));
    AuthorizationCodeTokenGranter authorizationCodeTokenGranter = new AuthorizationCodeTokenGranter(getDefaultTokenServices(),authorizationCodeServices(),getClientDetailsService(),new DefaultOAuth2RequestFactory(getClientDetailsService()));
    ImplicitTokenGranter implicitTokenGranter = new ImplicitTokenGranter(getDefaultTokenServices(),getClientDetailsService(),new DefaultOAuth2RequestFactory(getClientDetailsService()));
    tokenGranters.add(resourceOwnerPasswordTokenGranter);
    tokenGranters.add(clientCredentialsTokenGranter);
    tokenGranters.add(authorizationCodeTokenGranter);
    tokenGranters.add(implicitTokenGranter);
    return new CompositeTokenGranter(tokenGranters);
}
 
开发者ID:AgainstWind,项目名称:spring-cloud-demos,代码行数:15,代码来源:TestAuthorizationConfig.java


示例8: tokenGranter

import org.springframework.security.oauth2.provider.CompositeTokenGranter; //导入依赖的package包/类
private TokenGranter tokenGranter(final AuthorizationServerEndpointsConfigurer endpoints) {
    List<TokenGranter> granters = new ArrayList<>(Arrays.asList(endpoints.getTokenGranter()));
    extensionGrantManager.providers().forEach((id, tokenGranterProvider) -> {
        CustomTokenGranter customTokenGranter = new CustomTokenGranter(endpoints.getTokenServices(), endpoints.getClientDetailsService(), endpoints.getOAuth2RequestFactory(), extensionGrantManager.getTokenGranter(id));
        customTokenGranter.setExtensionGrantProvider(tokenGranterProvider);
        customTokenGranter.setAuthenticationEventPublisher(new DefaultAuthenticationEventPublisher(applicationEventPublisher));
        granters.add(customTokenGranter);
    });
    return new CompositeTokenGranter(granters);
}
 
开发者ID:gravitee-io,项目名称:graviteeio-access-management,代码行数:11,代码来源:AuthorizationServerConfiguration.java


示例9: compositeTokenGranter

import org.springframework.security.oauth2.provider.CompositeTokenGranter; //导入依赖的package包/类
private TokenGranter compositeTokenGranter(final ClientDetailsService clientService,
                                           final AuthenticationManager manager,
                                           final DefaultTokenServices tokenServices,
                                           final OAuth2RequestFactory requestFactory,
                                           final AuthorizationCodeServices authorizationCodeServices) {

    List<TokenGranter> granters = new ArrayList<>();
    granters.add(new ClientCredentialsTokenGranter(tokenServices, clientService, requestFactory));
    granters.add(new ImplicitTokenGranter(tokenServices, clientService, requestFactory));
    granters.add(new ResourceOwnerPasswordTokenGranter(manager, tokenServices, clientService, requestFactory));
    granters.add(new RefreshTokenGranter(tokenServices, clientService, requestFactory));
    granters.add(new AuthorizationCodeTokenGranter(tokenServices, authorizationCodeServices, clientService, requestFactory));
    return new CompositeTokenGranter(granters);
}
 
开发者ID:petrbouda,项目名称:joyrest,代码行数:15,代码来源:OAuth2Initializer.java


示例10: testCustomGrantRegistered

import org.springframework.security.oauth2.provider.CompositeTokenGranter; //导入依赖的package包/类
@Test
public void testCustomGrantRegistered() {
	TokenGranter granter = context.getBean(CompositeTokenGranter.class);
	assertNotNull("Custom grant registration failed!", granter.grant("test-grant", null));
}
 
开发者ID:jungyang,项目名称:oauth-client-master,代码行数:6,代码来源:AuthorizationServerCustomGrantParserTests.java



注:本文中的org.springframework.security.oauth2.provider.CompositeTokenGranter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PropertyDescriptor类代码示例发布时间:2022-05-22
下一篇:
Java Resty类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap