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

[Bug] key _AppTokenCache does not contain ClientId if not set in MicrosoftIdentityOptionss #40

Closed
jennyf19 opened this issue Feb 28, 2020 · 2 comments
Labels
bug Something isn't working investigate

Comments

@jennyf19
Copy link
Collaborator

If the ClientId is not set in MicrosoftIdentityOptions, and only in the ConfidentialClientApplicationOptions, then the cache key for the app cache does not contain the Client_id.

Ex:

 services.AddTransient(
_provider => Options.Create(new MicrosoftIdentityOptions
     {
          Authority = TestConstants.AuthorityCommonTenant,
          //ClientId = TestConstants.ConfidentialClientId,
     }));
services.AddTransient(
_provider => Options.Create(new ConfidentialClientApplicationOptions
    {
         Instance = TestConstants.AadInstance,
         TenantId = TestConstants.ConfidentialClientLabTenant,
         ClientId = TestConstants.ConfidentialClientId,
         ClientSecret = _ccaSecret
    }
));

the above will give this key : _AppTokenCache

But this:

 services.AddTransient(
_provider => Options.Create(new MicrosoftIdentityOptions
     {
          Authority = TestConstants.AuthorityCommonTenant,
          ClientId = TestConstants.ConfidentialClientId,
     }));
services.AddTransient(
_provider => Options.Create(new ConfidentialClientApplicationOptions
    {
         Instance = TestConstants.AadInstance,
         TenantId = TestConstants.ConfidentialClientLabTenant,
         ClientSecret = _ccaSecret
    }
));

will give d6921528-eb23-4423-a023-99b1b60f6285_AppTokenCache

@jennyf19 jennyf19 added bug Something isn't working investigate labels Feb 28, 2020
@jmprieur
Copy link
Collaborator

@jennyf19 proposing to close this one as it won't be necessary any longer when we fix #235.
do you agree?

@jennyf19
Copy link
Collaborator Author

good point. @jmprieur

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working investigate
Projects
None yet
Development

No branches or pull requests

2 participants