Skip to content
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

Merged
merged 2 commits into from
Aug 16, 2021
Merged

logout with oidc #3049

merged 2 commits into from
Aug 16, 2021

Conversation

neojunjie
Copy link
Contributor

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable)

#2735
calling identity provider to kill the logout session

@shirshanka
Copy link
Contributor

@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");
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

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}>
Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Collaborator

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();
Copy link
Collaborator

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?

Copy link
Contributor Author

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).

@@ -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()
Copy link
Collaborator

@jjoyce0510 jjoyce0510 Aug 9, 2021

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

Copy link
Contributor Author

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

Copy link
Collaborator

@jjoyce0510 jjoyce0510 left a 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!

@@ -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()
Copy link
Contributor Author

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

Copy link
Collaborator

@jjoyce0510 jjoyce0510 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thank you!

Copy link
Contributor

@shirshanka shirshanka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@shirshanka shirshanka merged commit bc2e71e into datahub-project:master Aug 16, 2021
rahulbsw pushed a commit to rahulbsw/datahub that referenced this pull request Sep 2, 2021
Co-authored-by: junjie <Jjlchiam4e>
@neojunjie neojunjie deleted the logout branch February 8, 2022 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants