-
Notifications
You must be signed in to change notification settings - Fork 117
Description
In your current offering of AzureAD support it assumes that the domain is always going to be login.microsoftonline.com
as per usage here:
hasura-auth/src/routes/oauth/config.ts
Lines 89 to 112 in c9b0829
azuread: { | |
grant: { | |
oauth: 2, | |
scope_delimiter: ' ', | |
client_id: process.env.AUTH_PROVIDER_AZUREAD_CLIENT_ID, | |
client_secret: process.env.AUTH_PROVIDER_AZUREAD_CLIENT_SECRET, | |
authorize_url: `${azureBaseUrl}/[subdomain]/oauth2/authorize`, | |
custom_params: { | |
prompt: 'select_account', | |
}, | |
access_url: `${azureBaseUrl}/[subdomain]/oauth2/token`, | |
profile_url: `${azureBaseUrl}/[subdomain]/openid/userinfo`, | |
subdomain: process.env.AUTH_PROVIDER_AZUREAD_TENANT || 'common', | |
dynamic: [], | |
}, | |
profile: ({ jwt }) => { | |
const payload = jwt?.id_token?.payload; | |
return { | |
id: payload.oid, | |
displayName: payload.name, | |
email: payload.email, | |
}; | |
}, | |
}, |
My application (nodejs) uses passport-azure-oauth2, which leverages the passport oauth strategy and leaves the base urls as configurable, which allows the library to be used with any azure AD product, in my case Azure b2c which uses a different tenant-based domain entirely.
It would be great to be able to pass additional configuration to override the base urls / issues / audience that are used in constructing the azure oauth2 flows. Happy to provide additional code if it's helpful.
Originally posted by @cjam in #625 (comment)