3

We have a client and service app where the client sends a Bearer token and we use that token on the service side to get AccessToken for other services like Graph endpoint. We are using the default TokenCache obtained using the AuthenticationContext. We are hitting an issue AdalException(AdalError.MultipleTokensMatched) on the server side. My question is

1) The code is still in prototype and no one else is using the client or the service except me, how can I end up here?

2) What exactly does it mean by TokenCache not ThreadSafe, and is there any better implementations of TokenCache on the service side which I can use rather than building it from scratch and validating.

{"multiple_matching_tokens_detected: The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements (e.g. UserId)"}

sri
  • 1,005
  • 1
  • 12
  • 26
  • 1
    What ADAL version are you using? 1) If you logged in using different user accounts but passed in null in the later calls then it would result in ambiguity and the API would return this error. 2) Token cache is implemented using ConcurrentDictionary, so it should be. API only provides a simple cache implementation and hooks in place for serialization/deserialization and other events. There is no separate cache for Server side. – Kanishk Panwar Jun 11 '15 at 23:45
  • Thanks @KanishkPanwar-MSFT I am using Microsoft.IdentityModel.Clients.ActiveDirectory.dll, v2.14.0.0. I found another Azure sample WebApp-WebAPI-OpenIDConnect-DotNet which I could use. – sri Jun 11 '15 at 23:52
  • Does this answer your question? [multiple\_matching\_tokens\_detected with ADAL](https://stackoverflow.com/questions/32000185/multiple-matching-tokens-detected-with-adal) – lesyk Sep 02 '20 at 07:24

0 Answers0