Comments (3)
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.
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.
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)
- Refresh Tokens do not seem to work on iOS HOT 4
- Update nuget description to point to MSAL.NET HOT 1
- use specific proxy when call api #37049 HOT 2
- AcquireTokenSilentAsync always fails in UWP HOT 28
- Unable to Acquire Token using cert and subject name auth from Powershell ISE
- Update ADAL communication with Broker to stop using AccountManager::GetAccount HOT 1
- Exception of type 'Microsoft.Identity.Client.MsalClientException' was thrown: password_required_for_managed_user HOT 1
- AcquireDeviceCodeAsync Failing on Mac OS HOT 1
- user is not able to login HOT 3
- Missing PlatformParameters constructor for .net core version of MS.IdentityModel.Clients.ActiveDirectory HOT 1
- Cannot install. Install-Package: Dependency loop detected for package 'Microsoft.IdentityModel.Clients.ActiveDirectory' HOT 10
- MS Docs: Please clarify what AssertionTypes would be valid here, or provide links to other documentation. HOT 1
- User is not able to signin HOT 4
- Device Auth incorrectly attempted on .NET classic
- [Bug] Auth Redirect failure in ADAL on iOS HOT 17
- ADAL webview with secure certificate on App UWP HOT 1
- DeserializeAdalV3(byte[]) needs exceptions listed HOT 2
- Get token using certificate assertion throws keyset does not exist HOT 3
- AuthenticationParameters.CreateFromUnauthorizedResponseAsync() is async but doesn't need to HOT 1
- GetAuthorizationRequestUrlAsync breaking change adds response_type=form_post HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-activedirectory-library-for-dotnet.