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

Should check tenantId and not jwtToken again #18

Closed
goofybryan opened this issue Dec 6, 2018 · 1 comment
Closed

Should check tenantId and not jwtToken again #18

goofybryan opened this issue Dec 6, 2018 · 1 comment

Comments

@goofybryan
Copy link

A check the jwtToken == null is done again, instead of tenantId == null or string.IsNullOrEmpty perhaps?

// Extracting the tenant ID
string tenantId = jwtToken.Claims.FirstOrDefault(c => c.Type == "tid")?.Value;
if (jwtToken == null)  // Should be if (string.IsNullOrEmpty(tentantId)) or if (tenantId == null)
{
    throw new SecurityTokenInvalidIssuerException("Expecting a tid claim from Azure Active Directory.");
}

@jmprieur
Copy link
Contributor

jmprieur commented Dec 6, 2018

Thanks @goofybryan !

This is now fixed in this sample,

I've raised a similar issue to fix it in https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2: See #26

cc: @kalyankrishna1

@jmprieur jmprieur closed this as completed Dec 6, 2018
jmprieur added a commit to Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2 that referenced this issue Dec 10, 2018
Also porting over the fix of Azure-Samples/active-directory-dotnet-native-aspnetcore-v2#18 which also apllies in this sample
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants