Check out the documentation on Configurable Token Lifetimes. You can set the default to 1 day, or use a refresh token to avoid that problem.
You can also try setting UseTokenLifetime = false if you don't want it to expire at all.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I published a Web ASP.NET Core App with Azure AD authentication successully on our Azure subscription.
The business logic of this web app is developed as api route, with json objects as input and output parameters.
I would like to expose this api to external applications (i.e. console application running outside the Azure subscription, calling a get/post httpclient) but I'm not able to set the correct authentication. Any calls to the web app api url return the html Azure sign-in page.
If I set a correct cookie (".AspNetCore.AzureADCookie") on the httpclient call, it works well, but the cookie expires after 1 hour.
How can I generate this cookie?
Otherwise, how can I authenticate the console application to Azure AD to successfully call web app api?
Thanks a lot,
Carlo
Check out the documentation on Configurable Token Lifetimes. You can set the default to 1 day, or use a refresh token to avoid that problem.
You can also try setting UseTokenLifetime = false if you don't want it to expire at all.