Search in sources :

Example 1 with AccessToken

use of com.mendmix.security.model.AccessToken in project jeesuite-libs by vakinge.

the class SecurityDelegating method createOauth2AccessToken.

public static AccessToken createOauth2AccessToken(AuthUser user) {
    UserSession session = getCurrentSession();
    session.setUser(user);
    getInstance().sessionManager.storageLoginSession(session);
    // 
    AccessToken accessToken = new AccessToken();
    accessToken.setAccess_token(session.getSessionId());
    accessToken.setRefresh_token(TokenGenerator.generate());
    accessToken.setExpires_in(session.getExpiresIn());
    return accessToken;
}
Also used : AccessToken(com.mendmix.security.model.AccessToken) UserSession(com.mendmix.security.model.UserSession)

Aggregations

AccessToken (com.mendmix.security.model.AccessToken)1 UserSession (com.mendmix.security.model.UserSession)1