Search in sources :

Example 6 with AccessToken

use of org.apache.cxf.rs.security.oauth.data.AccessToken in project tesb-rt-se by Talend.

the class OAuthManager method createAccessToken.

public AccessToken createAccessToken(AccessTokenRegistration reg) throws OAuthServiceException {
    RequestToken rt = reg.getRequestToken();
    String tokenId = UUID.randomUUID().toString();
    String tokenSecret = UUID.randomUUID().toString();
    at = new AccessToken(rt.getClient(), tokenId, tokenSecret);
    at.setSubject(rt.getSubject());
    at.setScopes(rt.getScopes());
    rt = null;
    return at;
}
Also used : RequestToken(org.apache.cxf.rs.security.oauth.data.RequestToken) AccessToken(org.apache.cxf.rs.security.oauth.data.AccessToken)

Aggregations

AccessToken (org.apache.cxf.rs.security.oauth.data.AccessToken)6 Client (org.apache.cxf.rs.security.oauth.data.Client)4 RequestToken (org.apache.cxf.rs.security.oauth.data.RequestToken)4 OAuthMessage (net.oauth.OAuthMessage)2 OAuthProblemException (net.oauth.OAuthProblemException)2 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 AuthorizationPolicy (org.apache.cxf.configuration.security.AuthorizationPolicy)1 AccessTokenRegistration (org.apache.cxf.rs.security.oauth.data.AccessTokenRegistration)1 OAuthPermission (org.apache.cxf.rs.security.oauth.data.OAuthPermission)1 OAuthServiceException (org.apache.cxf.rs.security.oauth.provider.OAuthServiceException)1