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

fix(OpenIdConnectRoutes): fix handleUnauthenticated #3617

Merged
merged 2 commits into from Aug 29, 2023

Conversation

mccle
Copy link
Contributor

@mccle mccle commented Aug 24, 2023

Context

Fixes Issue 3607. When using a secured dcm4chee archive, I was never redirected for sign in and left unable to use OHIF with my data.

Changes & Results

I modified handleUnauthenticated in OpenIdConnectRoutes.tsx to the following:

const handleUnauthenticated = async () => {
  await userManager.signinRedirect();

  // return null because this is used in a react component
  return null;
};

After making this change, I was redirected to this page:

Successful_Login

I was then able to successfully sign in and use OHIF as normal.

Testing

To test my changes, follow these steps:

  1. Set up a secured dcm4chee archive by following these instructions. It is potentially worth noting that I am using podman-compose as opposed to docker, but I completed the rest of the guide as described.
  2. Configure a new client for OHIF in the Keycloak administration console. Specifically, define a client_id and update the web origins to include the url where OHIF will be hosted.
  3. Update OHIF's configuration file to connect to your archive and add an oidc block as described here. The exact details will be specific to each set up.
  4. Host OHIF as described here with podman in place of docker.
  5. Navigate to the page where OHIF is hosted in a browser. You will be redirected to the sign in page if successful.
  6. Log in using your user credentials and verify OHIF maintains its expected functionality.

Checklist

PR

  • My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

  • My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • OS: Windows 11, MacOS 13.2.1
  • Node version: node:16.15.0-slim (Docker image)
  • Browser: Google Chrome 115.0.5790.170, Firefox 115.0.3, Firefox Developer Edition 117.0b7

@netlify
Copy link

netlify bot commented Aug 24, 2023

Deploy Preview for ohif-dev ready!

Name Link
🔨 Latest commit f512012
🔍 Latest deploy log https://app.netlify.com/sites/ohif-dev/deploys/64e76156e069e300085e5a8b
😎 Deploy Preview https://deploy-preview-3617--ohif-dev.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Aug 24, 2023

Deploy Preview for ohif-platform-docs ready!

Name Link
🔨 Latest commit f512012
🔍 Latest deploy log https://app.netlify.com/sites/ohif-platform-docs/deploys/64e761569e516800089ae071
😎 Deploy Preview https://deploy-preview-3617--ohif-platform-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Merging #3617 (f512012) into master (65b49ae) will not change coverage.
Report is 2 commits behind head on master.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3617   +/-   ##
=======================================
  Coverage   42.58%   42.58%           
=======================================
  Files          80       80           
  Lines        1463     1463           
  Branches      340      340           
=======================================
  Hits          623      623           
  Misses        675      675           
  Partials      165      165           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a2ef2b0...f512012. Read the comment docs.

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.

[Bug] No sign in redirect with secure dcm4chee archive
2 participants