-
Notifications
You must be signed in to change notification settings - Fork 25
Multiple login redirect urls #1368
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
Open
eilmiv
wants to merge
6
commits into
ElixirTeSS:master
Choose a base branch
from
pan-training:multiple_login_redirect_urls
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
25d6316
Support extra_redirect_uris to support login providers for spaces tha…
eilmiv acd0f2d
Support list as redirect_url for login providers
eilmiv 15f0054
Cleanup login provider redirect uri implementation
eilmiv 739fded
Add login redirect uri integration test
eilmiv d4e4e51
Use PublicSuffix instead of Rails default domain all option for sessi…
eilmiv 2c8b9d6
Update mail gem
eilmiv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,14 @@ | ||
| <% if devise_mapping.omniauthable? -%> | ||
| <% Devise.omniauth_configs.each do |provider, config| -%> | ||
| <%= link_to(omniauth_authorize_path(resource_name, provider), method: :post, | ||
| class: config.options[:logo] ? '' : | ||
| TeSS::Config.feature["login_through_oidc_only"] ? 'btn btn-default btn-lg btn-oidc-only' : 'btn btn-default') do %> | ||
| <% omniauth_providers_for_space.each do |provider, config| -%> | ||
| <%= omniauth_login_link(provider, config, | ||
| class: config.options[:logo] ? '' : | ||
| TeSS::Config.feature["login_through_oidc_only"] ? 'btn btn-default btn-lg btn-oidc-only' : 'btn btn-default') do %> | ||
| <% if config.options[:logo].present? %> | ||
| <%= image_tag(config.options[:logo], class: "omniauth-logo omniauth-#{provider}") -%> | ||
| <% else %> | ||
| <%= t('authentication.omniauth.log_in_with', | ||
| provider: config.options[:label] || t("authentication.omniauth.providers.#{provider}", default: provider.to_s.titleize)) -%> | ||
| <% end %> | ||
| <% end -%> | ||
| <% end %> | ||
| <% end -%> | ||
| <% end -%> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,24 @@ | ||
| # OpenID Connect configuration for LS Login nee Elixir AAI | ||
| unless Rails.application.config.secrets.dig(:elixir_aai, :client_id).blank? | ||
| redirect_uris = Array( | ||
| Rails.application.config.secrets.elixir_aai[:redirect_uri].presence || | ||
| # Url helper user_elixir_aai_omniauth_callback_url can not be used here | ||
| "#{TeSS::Config.base_url.chomp('/')}/users/auth/elixir_aai/callback" | ||
| ) | ||
|
|
||
| Devise.omniauth :openid_connect, { | ||
| logo: 'ls-login.png', | ||
| name: :elixir_aai, | ||
| scope: [:openid, :email, :profile], | ||
| response_type: :code, | ||
| issuer: 'https://login.aai.lifescience-ri.eu/oidc/', | ||
| discovery: true, | ||
| strategy_class: OmniAuth::Strategies::HostRedirectOpenIDConnect, | ||
| redirect_uris: redirect_uris, | ||
| client_options: { | ||
| identifier: Rails.application.config.secrets.elixir_aai[:client_id], | ||
| secret: Rails.application.config.secrets.elixir_aai[:secret], | ||
| # Wish I could use the url helper for this! (user_elixir_aai_omniauth_callback_url) | ||
| redirect_uri: "#{TeSS::Config.base_url.chomp('/')}/users/auth/elixir_aai/callback", | ||
| redirect_uri: redirect_uris.first, | ||
| } | ||
| } | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,24 @@ | ||
| # OpenID Connect configuration | ||
| unless Rails.application.config.secrets.dig(:oidc, :client_id).blank? | ||
| redirect_uris = Array( | ||
| Rails.application.config.secrets.oidc[:redirect_uri].presence || | ||
| "#{TeSS::Config.base_url.chomp('/')}/users/auth/oidc/callback" | ||
| ) | ||
|
|
||
| Devise.omniauth :openid_connect, { | ||
| name: :oidc, | ||
| label: Rails.application.config.secrets.oidc[:label], | ||
| logo: Rails.application.config.secrets.oidc[:logo], | ||
| issuer: Rails.application.config.secrets.oidc[:issuer], | ||
| strategy_class: OmniAuth::Strategies::OpenIDConnect, | ||
| strategy_class: OmniAuth::Strategies::HostRedirectOpenIDConnect, | ||
| scope: [:openid, :email, :profile], | ||
| response_type: :code, | ||
| discovery: true, | ||
| redirect_uris: redirect_uris, | ||
| client_options: { | ||
| identifier: Rails.application.config.secrets.oidc[:client_id], | ||
| secret: Rails.application.config.secrets.oidc[:secret], | ||
| redirect_uri: Rails.application.config.secrets.oidc[:redirect_uri].presence || | ||
| "#{TeSS::Config.base_url.chomp('/')}/users/auth/oidc/callback" | ||
| redirect_uri: redirect_uris.first | ||
| } | ||
| } | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,24 @@ | ||
| # Secondary OpenID Connect configuration | ||
| unless Rails.application.config.secrets.dig(:oidc2, :client_id).blank? | ||
| redirect_uris = Array( | ||
| Rails.application.config.secrets.oidc2[:redirect_uri].presence || | ||
| "#{TeSS::Config.base_url.chomp('/')}/users/auth/oidc2/callback" | ||
| ) | ||
|
|
||
| Devise.omniauth :openid_connect, { | ||
| name: :oidc2, | ||
| label: Rails.application.config.secrets.oidc2[:label], | ||
| logo: Rails.application.config.secrets.oidc2[:logo], | ||
| issuer: Rails.application.config.secrets.oidc2[:issuer], | ||
| strategy_class: OmniAuth::Strategies::OpenIDConnect, | ||
| strategy_class: OmniAuth::Strategies::HostRedirectOpenIDConnect, | ||
| scope: [:openid, :email, :profile], | ||
| response_type: :code, | ||
| discovery: true, | ||
| redirect_uris: redirect_uris, | ||
| client_options: { | ||
| identifier: Rails.application.config.secrets.oidc2[:client_id], | ||
| secret: Rails.application.config.secrets.oidc2[:secret], | ||
| redirect_uri: Rails.application.config.secrets.oidc2[:redirect_uri].presence || | ||
| "#{TeSS::Config.base_url.chomp('/')}/users/auth/oidc2/callback" | ||
| redirect_uri: redirect_uris.first | ||
| } | ||
| } | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.