-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
logout with oidc #3049
logout with oidc #3049
Conversation
@jjoyce0510 : can you review? |
? config.getString(AUTH_BASE_URL_CONFIG_PATH) | ||
: DEFAULT_BASE_URL_PATH; | ||
|
||
_isOidcEnabled = config.hasPath("auth.oidc.enabled") && config.getBoolean("auth.oidc.enabled"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we reuse some static constants for these string values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont see how they can be reused at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They should be inside the OidcConfigs.java class as public static strings
@@ -65,8 +65,10 @@ export const ManageAccount = ({ urn: _urn, pictureLink: _pictureLink, name }: Pr | |||
</MenuItem> | |||
); | |||
})} | |||
<MenuItem id="user-profile-menu-logout" danger key="logout" onClick={handleLogout} tabIndex={0}> | |||
Log out | |||
<MenuItem danger key="logout" tabIndex={0}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you validated that this still works for both OIDC and non-oidc (jaas) authentication modes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we validated in our env that it works for both OIDC (keycloak) and non-oidc authentication modes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay - thank you for confirming!
*/ | ||
public Result executeLogout() throws ExecutionException, InterruptedException { | ||
if (_isOidcEnabled) { | ||
return logout().toCompletableFuture().get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this also delete the PLAY_SESSION cookie that DataHub uses for authentication?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, it will not delete the PLAY_SESSION cookie. It is still handled by MangeAccount (react).
datahub-frontend/conf/routes
Outdated
@@ -45,6 +45,7 @@ GET /authenticate re | |||
POST /logIn react.controllers.AuthenticationController.logIn() | |||
GET /callback/oidc @org.pac4j.play.CallbackController.callback() | |||
POST /callback/oidc @org.pac4j.play.CallbackController.callback() | |||
GET /centralLogout controllers.CentralLogoutController.executeLogout() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we just call this "/logOut" for simplicity + consistency? The controller can figure out how to do that based on what auth mechanisms are enabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will make the change shortly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple small comments. Overall looking great!
…eAccount to call the new endpoint
@@ -45,6 +45,7 @@ GET /authenticate re | |||
POST /logIn react.controllers.AuthenticationController.logIn() | |||
GET /callback/oidc @org.pac4j.play.CallbackController.callback() | |||
POST /callback/oidc @org.pac4j.play.CallbackController.callback() | |||
GET /logOut controllers.CentralLogoutController.executeLogout() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed to logOut as suggested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Co-authored-by: junjie <Jjlchiam4e>
Checklist
#2735
calling identity provider to kill the logout session