Example usage for org.springframework.security.oauth2.provider.implicit ImplicitTokenRequest ImplicitTokenRequest

List of usage examples for org.springframework.security.oauth2.provider.implicit ImplicitTokenRequest ImplicitTokenRequest

Introduction

In this page you can find the example usage for org.springframework.security.oauth2.provider.implicit ImplicitTokenRequest ImplicitTokenRequest.

Prototype

public ImplicitTokenRequest(TokenRequest tokenRequest, OAuth2Request oauth2Request) 

Source Link

Usage

From source file:org.joyrest.oauth2.endpoint.AuthorizationEndpoint.java

private OAuth2AccessToken getAccessTokenForImplicitGrant(TokenRequest tokenRequest,
        OAuth2Request storedOAuth2Request) {
    OAuth2AccessToken accessToken;/*from www.j a  v a 2s . c o  m*/
    // These 1 method calls have to be atomic, otherwise the ImplicitGrantService can have a race condition where
    // one thread removes the token request before another has a chance to redeem it.
    synchronized (this.implicitLock) {
        accessToken = tokenGranter.grant("implicit",
                new ImplicitTokenRequest(tokenRequest, storedOAuth2Request));
    }
    return accessToken;
}

From source file:org.cloudfoundry.identity.uaa.oauth.UaaAuthorizationEndpoint.java

private OAuth2AccessToken getAccessTokenForImplicitGrantOrHybrid(TokenRequest tokenRequest,
        OAuth2Request storedOAuth2Request, String grantType) throws OAuth2Exception {
    // These 1 method calls have to be atomic, otherwise the ImplicitGrantService can have a race condition where
    // one thread removes the token request before another has a chance to redeem it.
    synchronized (this.implicitLock) {
        switch (grantType) {
        case GRANT_TYPE_IMPLICIT:
            return getTokenGranter().grant(grantType,
                    new ImplicitTokenRequest(tokenRequest, storedOAuth2Request));
        case GRANT_TYPE_AUTHORIZATION_CODE:
            return getHybridTokenGranterForAuthCode().grant(grantType,
                    new ImplicitTokenRequest(tokenRequest, storedOAuth2Request));
        default://from w  w w  .  j  a va  2  s .co  m
            throw new OAuth2Exception(OAuth2Exception.INVALID_GRANT);
        }
    }
}

From source file:org.springframework.security.oauth2.provider.endpoint.AuthorizationEndpoint.java

private OAuth2AccessToken getAccessTokenForImplicitGrant(TokenRequest tokenRequest,
        OAuth2Request storedOAuth2Request) {
    OAuth2AccessToken accessToken = null;
    // These 1 method calls have to be atomic, otherwise the ImplicitGrantService can have a race condition where
    // one thread removes the token request before another has a chance to redeem it.
    synchronized (this.implicitLock) {
        accessToken = getTokenGranter().grant("implicit",
                new ImplicitTokenRequest(tokenRequest, storedOAuth2Request));
    }/*from  ww  w .  java  2  s.com*/
    return accessToken;
}