use of org.apache.cxf.rs.security.oauth2.common.AccessTokenRegistration in project tesb-rt-se by Talend.
the class OAuthManager method createAccessToken.
// token management
public ServerAccessToken createAccessToken(AccessTokenRegistration reg) throws OAuthServiceException {
ServerAccessToken token = new BearerAccessToken(reg.getClient(), 3600L);
List<String> scope = reg.getApprovedScope().isEmpty() ? reg.getRequestedScope() : reg.getApprovedScope();
token.setScopes(convertScopeToPermissions(reg.getClient(), scope));
token.setSubject(reg.getSubject());
token.setGrantType(reg.getGrantType());
at = token;
return token;
}
Aggregations