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

Add support to the CHT api for new endpoint for OIDC login #9765

Open
jkuester opened this issue Jan 29, 2025 · 2 comments
Open

Add support to the CHT api for new endpoint for OIDC login #9765

jkuester opened this issue Jan 29, 2025 · 2 comments
Assignees
Labels
Type: Feature Add something new

Comments

@jkuester
Copy link
Contributor

jkuester commented Jan 29, 2025

  • The /medic/login/oidc endpoint should support GET requests with a code query param. The code should be the authorization_code coming from the OIDC Provider.
  • This is the endpoint the OIDC Provider should re-direct back to.
  • Add a new getOidc function in api/src/controllers/login.js that will handle the request and call through to code in the openid-client to validate the authorization_code.
  • For a good authorization_code, the OIDC Provider should return an id_token containing the username for the authenticated user.
  • Lookup the user's doc in _userand confirm oidc_provider value is set
  • Generate a Couch session cookie for user and respond with valid user session.
    • This will require access to the Couch secret value which can be requested from the Couch instance. There is some code in the proxy auth PR that does this. I think we might be able to put that functionality for getting the secret into shared-libs/settings (or maybe that code is already sufficient for retrieving the secret value?).
  • Add integration tests for the login controller
@benkags
Copy link

benkags commented Feb 18, 2025

@jkuester please assign me this ticket

@jkuester
Copy link
Contributor Author

@benkags Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Add something new
Projects
None yet
Development

No branches or pull requests

2 participants