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

Implement nextUrl for OpenID Authentication #1563

Merged
merged 13 commits into from
Dec 8, 2023

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Aug 25, 2023

Description

Adds support for nextUrl in OpenID Authentication. This change also supports nextUrl for multi authentication.

If a user's session times out, they will resume where they previously left off instead of being directed back to the home page.

This change is modeled off of similar work done for SAML:

Related PRs:

Category

Enhancement

Issues Resolved

#1141

Testing

Tested using a keycloak IdP in local development. Opening this PR up as a draft as functional tests are written for this change to verify the new behavior.

I'm pushing the function test repo to update to Cypress12 which has official support for cross-origin testing: opensearch-project/opensearch-dashboards-functional-test#801

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
@codecov
Copy link

codecov bot commented Aug 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6dcd7d5) 67.06% compared to head (78489f7) 67.09%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1563      +/-   ##
==========================================
+ Coverage   67.06%   67.09%   +0.02%     
==========================================
  Files          94       94              
  Lines        2402     2404       +2     
  Branches      318      323       +5     
==========================================
+ Hits         1611     1613       +2     
  Misses        713      713              
  Partials       78       78              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@DarshitChanpura DarshitChanpura left a comment

Choose a reason for hiding this comment

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

@cwperks Are you still working on this? Do you need extra hands to get this through?

@DarshitChanpura
Copy link
Member

It will be picked back up once #1579 is merged

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
@cwperks cwperks marked this pull request as ready for review November 30, 2023 22:21
@cwperks
Copy link
Member Author

cwperks commented Dec 1, 2023

@RyanL1997 @derek-ho @DarshitChanpura This is ready for review.

Copy link
Collaborator

@RyanL1997 RyanL1997 left a comment

Choose a reason for hiding this comment

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

Hi @cwperks, thanks for putting this up, and I just left some comments.

test/cypress/e2e/oidc/oidc_auth_test.spec.js Show resolved Hide resolved
server/auth/types/openid/routes.ts Show resolved Hide resolved
test/cypress/e2e/oidc/oidc_auth_test.spec.js Show resolved Hide resolved
server/auth/types/openid/openid_auth.ts Show resolved Hide resolved
@RyanL1997
Copy link
Collaborator

Btw I think we need to update the branch with the latest changes

@cwperks cwperks added the backport 2.x backport to 2.x branch label Dec 7, 2023
@peternied peternied merged commit 6374198 into opensearch-project:main Dec 8, 2023
12 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-1563-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 6374198119fcb2b33343460a3d2fdfcb44794f30
# Push it to GitHub
git push --set-upstream origin backport/backport-1563-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-1563-to-2.x.

@cwperks
Copy link
Member Author

cwperks commented Dec 8, 2023

I'll open up a manual backport for this.

@cwperks
Copy link
Member Author

cwperks commented Dec 8, 2023

The backport for this is blocked by the backport for: #1579

@cwperks cwperks added backport 2.x backport to 2.x branch and removed backport 2.x backport to 2.x branch labels Dec 18, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 18, 2023
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Co-authored-by: Darshit Chanpura <35282393+DarshitChanpura@users.noreply.github.com>
(cherry picked from commit 6374198)
cwperks added a commit that referenced this pull request Dec 18, 2023
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Co-authored-by: Darshit Chanpura <35282393+DarshitChanpura@users.noreply.github.com>
(cherry picked from commit 6374198)

Co-authored-by: Craig Perkins <cwperx@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants