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

DRYD-1242: Implement OAuth authorization code grant flow for sign in. #189

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

ray-lee
Copy link
Member

@ray-lee ray-lee commented Sep 20, 2023

What does this do?

This utilizes the OAuth authorization code grant flow for sign in, instead of the password grant flow. As a consequence, this application is no longer responsible for authentication, and no longer accepts the user's email and password. Instead, authentication is delegated to the services layer, and the UI is only responsible for authorizing itself as an OAuth client.

Since the services layer now needs a minimal UI to allow users to log in, log out, and reset their password, the build now produces an additional compiled module, cspaceUI-service.js. This module implements a small app that can be displayed by the services layer to handle the above functionality.

Why are we doing this? (with JIRA link)

Upgrading Spring Security in the services layer removed support for the password code grant (which is no longer in the latest versions of OAuth). This also makes it easier to add new forms of user authentication in the future (e.g SSO, two-factor). Since user authentication is now decoupled from client authorization, new authentication schemes can be added only by changing the services layer, and clients can remain unchanged.

JIRA: https://collectionspace.atlassian.net/browse/DRYD-1242

How should this be tested? Do these changes have associated tests?

Login and logout from a CSpace 8.0 server should work. The login page in the UI should now only show a button that opens the login page in the services layer. After logging in, the browser should redirect back to the UI. Clicking the logout link should now open the logout page in the services layer, and logging out from there should redirect back to the UI.

Some unit tests haven't been written yet. These will be in a future PR.

Dependencies for merging? Releasing to production?

This should only be released with an 8.0 services layer.

Has the application documentation been updated for these changes?

I will add documentation about the login flow to the developer documentation in a future PR.

Did someone actually run this code to verify it works?

@ray-lee ran this locally.

@ray-lee ray-lee changed the title Implement OAuth authorization code grant flow for sign in. DRYD-1241: Implement OAuth authorization code grant flow for sign in. Sep 20, 2023
@ray-lee ray-lee changed the title DRYD-1241: Implement OAuth authorization code grant flow for sign in. DRYD-1242: Implement OAuth authorization code grant flow for sign in. Sep 20, 2023
This replaces the password grant flow.
@ray-lee ray-lee marked this pull request as ready for review September 20, 2023 15:24
@ray-lee ray-lee merged commit 5ee0d95 into collectionspace:master Sep 20, 2023
2 of 3 checks passed
@ray-lee ray-lee deleted the auth-code-login-flow branch September 20, 2023 15:24
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.

1 participant