According to the passport-azure-ad documentation, I should be able to specify a list of issuers as a string array.
However, I'm having trouble getting the second example below to work.
The first example works fine:
Example 1 - Works with a token issued by <TENANT_1_GUID>
{
identityMetadata: 'https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration',
issuer: [
'https://login.microsoftonline.com/<TENANT_1_GUID>/v2.0'
],
clientID: '<APP_GUID>',
validateIssuer: true,
}
Example 2 - Does not work with a token issued by <TENANT_1_GUID> or <TENANT_2_GUID>
But my problem is that that the token is not successfully validated when a list of acceptable issuers is provided:-
{
identityMetadata: 'https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration',
issuer: [
'https://login.microsoftonline.com/<TENANT_1_GUID>/v2.0',
'https://login.microsoftonline.com/<TENTANT_2_GUID>/v2.0'
],
clientID: '<APP_GUID>',
validateIssuer: true,
}
Is this not the correct way to validate a token that could have come between one of two tenants?
Thanks!
I've come up with something that works... created a middlewear with the passport in it:-