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

Oauth2 integration #2953

Merged
merged 6 commits into from
Sep 10, 2024
Merged

Oauth2 integration #2953

merged 6 commits into from
Sep 10, 2024

Conversation

CDimonaco
Copy link
Member

@CDimonaco CDimonaco commented Sep 9, 2024

Description

This PR adds support for Oauth2 SSO method.

All the runtime parameters, needed claims and scopes, will be later documented.
Locally we can use our keycloak instance with the same client who supports also plain oauth2, the local scopes are tailored to work with our local keycloak.

Tested also with Auth0.

This PR also adds supports for multiple forms of SSO, allowing for multiple integrations.
The SSO username retrieving is refactored.

To test it locally, in the dev.local.exs add

config :trento, :oidc, enabled: false
config :trento, :oauth2, enabled: true

How was this tested?

Automatic and manual testing.

@CDimonaco CDimonaco added enhancement New feature or request elixir Pull requests that update Elixir code labels Sep 9, 2024
@CDimonaco CDimonaco self-assigned this Sep 9, 2024
Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

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

Lovely ❤️
I don't know if I like much the OidcOauth file naming, but well, I understand why you chose it hehe

config/dev.exs Show resolved Hide resolved
config/dev.exs Outdated Show resolved Hide resolved
config/runtime.exs Outdated Show resolved Hide resolved
lib/trento_web/controllers/page_controller.ex Show resolved Hide resolved
lib/trento_web/controllers/v1/users_controller.ex Outdated Show resolved Hide resolved
test/trento/user_identities_test.exs Show resolved Hide resolved
Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

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

Hey @CDimonaco ,
I was testing the PR and i was having an error.
Adding the single line in my comment fixes it, but I don't know if something else could be affecting

Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

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

Fantastic!

@CDimonaco CDimonaco merged commit 670d11c into main Sep 10, 2024
30 checks passed
@CDimonaco CDimonaco deleted the oauth2_integration branch September 10, 2024 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
elixir Pull requests that update Elixir code enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

2 participants