Search in sources :

Example 1 with AccessToken

use of com.jeesuite.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.jeesuite.security.model.AccessToken) UserSession(com.jeesuite.security.model.UserSession)

Aggregations

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