I am building a multi tenant web app that connects Office 365 services using Microsoft.Owin.Security.OpenIdConnect, Version=3.0.0.0 and Azure Active Directory with
Actually,
I needed to set UseTokenLifetime = false
.
Indeed, UseTokenLifetime = true
changes the internal ticket in the Asp.NET cookie to the default lifetime of access_token
which is one hour.
The comments from @Tratcher were true but mislead me... Yes the access_token
lifetime is controlled by Azure AD and there is nothing that I can do about it. But, we implemented the refresh_token
management with ADAL.NET so there is a possibility to keep authentication/authorization with Microsoft Identity server for more than one hour. Setting UseTokenLifetTime = false
and use cookie authentication with 15 days sliding expiry time between my client app and my server works like a charm now.