question

FrancescoAncona-9077 avatar image
0 Votes"
FrancescoAncona-9077 asked ·

.NET Mvc app with MS Azure Authentication refresh

'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!

azure-active-directoryadfs
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LeonLaude avatar image
0 Votes"
LeonLaude answered ·

.NET MVC is currently not supported in the Q&A forums, the supported products are listed over here https://docs.microsoft.com/en-us/answers/products (more to be added later on).

You can ask the experts in the dedicated .NET MVC forum over here:
https://forums.asp.net/1146.aspx/1?MVC

(Please don't forget to accept helpful replies as answer)

Best regards,
Leon

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.