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

Update entra_id.rb #39

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/omniauth/strategies/entra_id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class EntraId < OmniAuth::Strategies::OAuth2

DEFAULT_SCOPE = 'openid profile email'
COMMON_TENANT_ID = 'common'

ADFS_TENANT_ID = 'adfs'
# The tenant_provider must return client_id, client_secret and,
# optionally, tenant_id and base_url.
#
Expand Down Expand Up @@ -135,9 +135,9 @@ def raw_info

# For multi-tenant apps (the 'common' tenant_id) it doesn't make any
# sense to verify the token issuer, because the value of 'iss' in the
# token depends on the 'tid' in the token itself.
# token depends on the 'tid' in the token itself. We should also skip for ADFS local instance, as we dont put a valid tenant id in its place, but adfs instead
#
issuer = if options.tenant_id.nil? || options.tenant_id == COMMON_TENANT_ID
issuer = if options.tenant_id.nil? || options.tenant_id == COMMON_TENANT_ID || options.tenant_id == ADFS_TENANT_ID
nil
else
"#{options.base_url || BASE_URL}/#{options.tenant_id}/v2.0"
Expand Down
Loading