've integrated the Azure authentication in an MVC application via Owin libraries.
HttpContext.Current.GetOwinContext().Authentication.Challenge(
new AuthenticationProperties { RedirectUri = baseurl + "Login/Index", AllowRefresh = true },
OpenIdConnectAuthenticationDefaults.AuthenticationType);
After this, i faced a problem with the Azure session expiration after an hour. To solve this, i implemented a call (for test purposes every 45 minutes) to the Challenge method, like this:
HttpContext.ApplicationInstance.Context.GetOwinContext().Authentication.Challenge(
new AuthenticationProperties { RedirectUri = MvcApplication.Authentication.AdfsAzure.ADFSUrl + "Reserved/Main/VoidAction/", AllowRefresh = true, IsPersistent = true },
OpenIdConnectAuthenticationDefaults.AuthenticationType);
The call ended succesfully but, after this, the Session cookie for the .NET mvc application (with name .ASPXAUTH_ARCHIFLOW_CURRENT) changed and the instance Session lost. Have you any idea to solve this? Or is there a different way to implement this token refresh? To give a complete view of the environment, i've removed the tag in the application web.config.
Many thanks at all!