You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.
I am in the process of setting up a multi-tenant SSO (i.e. outside of my own Azure domains) and ran into the following:
The Authorisation endpoint for a multi-tenant auth needs to be /common/ instead of /[tenant_id]/ as reported by the configuration from Azure
When authenticating a multi-tenant app, we cannot verify the issuer, since it could be any Azure Tenant, not only our own. I'm not familiar enough with JWT to understand the full security impact of this change
Below is my monkey-patch (from config/initialisers/devise.rb) that seems to have solved the situation for me.
# ==> OmniAuth# Add a new OmniAuth provider. Check the wiki for more information on setting# up on your models and hooks.# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'config.omniauth:azure_activedirectory,Settings.azure.aad_client_id,Settings.azure.aad_tenant# monkey-patchmoduleOmniAuthmoduleStrategiesclassAzureActiveDirectorydefauthorize_endpoint_urlwrong_uri=URI(openid_config['authorization_endpoint'])# as per http://stackoverflow.com/a/32529128uri=URI('https://login.microsoftonline.com/common/oauth2/authorize')uri.query=URI.encode_www_form(client_id: client_id,redirect_uri: callback_url,response_mode: response_mode,response_type: response_type,nonce: new_nonce)uri.to_senddefverify_options{verify_expiration: true,verify_not_before: true,verify_iat: true,# I am somewhat uneasy about this solution, since it allows any issuer to provide credential info.# However, since the issuer is ?guaranteed? to be an Azure Tenant, we're OK. Or are we? (gulp)# TODO: Investigate# verify_iss: true,# 'iss' => issuer,verify_aud: true,'aud'=>client_id}endendendend
The text was updated successfully, but these errors were encountered:
I am in the process of setting up a multi-tenant SSO (i.e. outside of my own Azure domains) and ran into the following:
Below is my monkey-patch (from config/initialisers/devise.rb) that seems to have solved the situation for me.
The text was updated successfully, but these errors were encountered: