mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
CB-2228 expire success auth attempt (#943)
This commit is contained in:
+2
@@ -106,6 +106,8 @@ public class WebServiceAuthImpl implements DBWServiceAuth {
|
||||
return new WebAuthStatus(smAuthInfo.getAuthAttemptId(), smAuthInfo.getRedirectUrl(), smAuthInfo.getAuthStatus());
|
||||
case ERROR:
|
||||
throw new DBWebException(smAuthInfo.getError());
|
||||
case EXPIRED:
|
||||
throw new DBException("Authorization has already been processed");
|
||||
default:
|
||||
throw new DBWebException("Unknown auth status:" + smAuthInfo.getAuthStatus());
|
||||
}
|
||||
|
||||
+6
-1
@@ -1067,13 +1067,18 @@ public class CBEmbeddedSecurityController implements SMAdminController, SMAuthen
|
||||
return SMAuthInfo.inProgress(authId, redirectUrl, authData);
|
||||
case ERROR:
|
||||
return SMAuthInfo.error(authId, authError);
|
||||
case EXPIRED:
|
||||
return SMAuthInfo.expired(authId);
|
||||
default:
|
||||
throw new SMException("Unknown auth status:" + smAuthStatus);
|
||||
}
|
||||
}
|
||||
|
||||
String smToken = findTokenBySmSession(smSessionId);
|
||||
return SMAuthInfo.success(authId, smToken, getTokenPermissions(smToken), authData);
|
||||
SMAuthPermissions authPermissions = getTokenPermissions(smToken);
|
||||
var successAuthStatus = SMAuthInfo.success(authId, smToken, authPermissions, authData);
|
||||
updateAuthStatus(authId, SMAuthStatus.EXPIRED, authData, null, authPermissions.getSessionId());
|
||||
return successAuthStatus;
|
||||
|
||||
} catch (SQLException e) {
|
||||
throw new DBException("Error while read auth info", e);
|
||||
|
||||
Reference in New Issue
Block a user