Search in sources :

Example 1 with SSOCredential

use of com.diboot.iam.dto.SSOCredential in project diboot by dibo-software.

the class SSOAuthServiceImpl method initBaseJwtAuthToken.

/**
 * 初始化JwtAuthToken实例
 * @param credential
 * @return
 */
private BaseJwtAuthToken initBaseJwtAuthToken(AuthCredential credential) {
    // 通过CAS得到账号
    SSOCredential ssoCredential = (SSOCredential) credential;
    BaseJwtAuthToken token = new BaseJwtAuthToken(getAuthType(), ssoCredential.getUserTypeClass());
    String username = parseCasTicket(ssoCredential);
    ssoCredential.setAuthAccount(username);
    // 设置账号密码
    token.setAuthAccount(ssoCredential.getAuthAccount());
    token.setTenantId(credential.getTenantId());
    token.setRememberMe(ssoCredential.isRememberMe());
    // 生成token
    return token.generateAuthtoken(getExpiresInMinutes());
}
Also used : BaseJwtAuthToken(com.diboot.iam.jwt.BaseJwtAuthToken) SSOCredential(com.diboot.iam.dto.SSOCredential)

Aggregations

SSOCredential (com.diboot.iam.dto.SSOCredential)1 BaseJwtAuthToken (com.diboot.iam.jwt.BaseJwtAuthToken)1