本文整理汇总了Java中org.springframework.security.oauth2.client.token.grant.implicit.ImplicitAccessTokenProvider类的典型用法代码示例。如果您正苦于以下问题:Java ImplicitAccessTokenProvider类的具体用法?Java ImplicitAccessTokenProvider怎么用?Java ImplicitAccessTokenProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ImplicitAccessTokenProvider类属于org.springframework.security.oauth2.client.token.grant.implicit包,在下文中一共展示了ImplicitAccessTokenProvider类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: MyOAuth2RestTemplate
import org.springframework.security.oauth2.client.token.grant.implicit.ImplicitAccessTokenProvider; //导入依赖的package包/类
public MyOAuth2RestTemplate(OAuth2ProtectedResourceDetails resource, OAuth2ClientContext context) {
super(resource, context);
this.accessTokenProvider = new MyAccessTokenProviderChain(Arrays.asList(new AccessTokenProvider[]{new MyAuthorizationCodeAccessTokenProvider(),
new ImplicitAccessTokenProvider(),
new ResourceOwnerPasswordAccessTokenProvider(),
new ClientCredentialsAccessTokenProvider()}));
this.retryBadAccessTokens = true;
this.authenticator = new DefaultOAuth2RequestAuthenticator();
if(resource == null) {
throw new IllegalArgumentException("An OAuth2 resource must be supplied.");
} else {
this.resource = resource;
this.context = context;
this.setErrorHandler(new OAuth2ErrorHandler(resource));
}
}
开发者ID:luotuo,项目名称:springboot-security-wechat,代码行数:17,代码来源:MyOAuth2RestTemplate.java
示例2: testPostForAutomaticApprovalToken
import org.springframework.security.oauth2.client.token.grant.implicit.ImplicitAccessTokenProvider; //导入依赖的package包/类
@Test
@OAuth2ContextConfiguration(resource = AutoApproveImplicit.class, initialize = false)
public void testPostForAutomaticApprovalToken() throws Exception {
final ImplicitAccessTokenProvider implicitProvider = new ImplicitAccessTokenProvider();
implicitProvider.setInterceptors(Arrays
.<ClientHttpRequestInterceptor> asList(new ClientHttpRequestInterceptor() {
public ClientHttpResponse intercept(HttpRequest request, byte[] body,
ClientHttpRequestExecution execution) throws IOException {
ClientHttpResponse result = execution.execute(request, body);
latestHeaders = result.getHeaders();
return result;
}
}));
context.setAccessTokenProvider(implicitProvider);
context.getAccessTokenRequest().setCookie(cookie);
assertNotNull(context.getAccessToken());
assertTrue("Wrong location header: " + latestHeaders.getLocation().getFragment(), latestHeaders.getLocation().getFragment()
.contains("scope=read write trust"));
}
开发者ID:jungyang,项目名称:oauth-client-master,代码行数:20,代码来源:ImplicitProviderTests.java
示例3: FeignOAuthInterceptor
import org.springframework.security.oauth2.client.token.grant.implicit.ImplicitAccessTokenProvider; //导入依赖的package包/类
public FeignOAuthInterceptor(OAuth2ClientContext oAuth2ClientContext) {
super(oAuth2ClientContext, null);
this.oAuth2ClientContext = oAuth2ClientContext;
this.accessTokenProvider = new AccessTokenProviderChain(Arrays.asList(new AuthorizationCodeAccessTokenProvider(),
new ImplicitAccessTokenProvider(), new ResourceOwnerPasswordAccessTokenProvider(),
new ClientCredentialsAccessTokenProvider()));
}
开发者ID:rhawan,项目名称:microservices-tcc-alfa,代码行数:8,代码来源:FeignOAuthInterceptor.java
示例4: accessTokenProviderChain
import org.springframework.security.oauth2.client.token.grant.implicit.ImplicitAccessTokenProvider; //导入依赖的package包/类
@Bean
public AccessTokenProvider accessTokenProviderChain() {
return new AccessTokenProviderChain(Arrays.<AccessTokenProvider> asList(
new OpenIDTokenProvider(),
new AuthorizationCodeAccessTokenProvider(), new ImplicitAccessTokenProvider(),
new ResourceOwnerPasswordAccessTokenProvider(), new ClientCredentialsAccessTokenProvider()));
}
开发者ID:pivotal-cf,项目名称:identity-sample-apps,代码行数:8,代码来源:Application.java
注:本文中的org.springframework.security.oauth2.client.token.grant.implicit.ImplicitAccessTokenProvider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论