Giter Site home page Giter Site logo

Comments (3)

vibronet avatar vibronet commented on May 23, 2024 1

The feature is definitely implemented. Are you executing the example code precisely as is, or did you modify anything in it? Typical issues with AcquireTokenSilent in web scenarios are:

  • The cache is empty. AcquireTokenSilent works by returning cached tokens or using refresh tokens from the cache. In the OpenId Connect samples, the application first acquires access and refresh tokens at sign in time and places them in a cache instance. If something happens to the cache between that time and the time in which you call AcquireTokenSilent, or if you fail to initialize AuthenticationContext with the exact same cache instance, the request will fail.
  • The cache contains more than one token matching the parameters, for example for 2 different users. In that case ADAL needs more info (like the ID of the user you want ta token for) to disambiguate the request
  • You are requesting a token from a new AAD tenant. Refresh tokens in the cache will work for requesting new tokens only from the same tenant they were originally issued from
    You can verify in which situation you are by inspecting the content of the cache before making your AcquireTokenSilent call, simply call myAuthContext.TokenCache.ReadItems and examine the results in the debugger.
    HTH

from azure-activedirectory-library-for-dotnet.

rlongodev avatar rlongodev commented on May 23, 2024

Hi Vittorio, thanks a lot for the quick response. You are right, I think I misunderstood the samples and my scenario its a little bit different. Thing is I didn't get a token before a call to AcquireTokenSilent.

Regards,
Rodrigo

from azure-activedirectory-library-for-dotnet.

kpanwar avatar kpanwar commented on May 23, 2024

If you use the latest 2.24 then you will get an inner exception that will tell you why acquire token silent failed. Can you check and share the details.

from azure-activedirectory-library-for-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.