org.springframework.security.oauth2.client.token.grant.implicit.ImplicitAccessTokenProvider Java Examples

The following examples show how to use org.springframework.security.oauth2.client.token.grant.implicit.ImplicitAccessTokenProvider. 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: MyOAuth2RestTemplate.java    From springboot-security-wechat with Apache License 2.0 6 votes vote down vote up
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));
    }
}