It seems like you're facing a problem with redirecting to the default page after successful authorization when using Microsoft's built-in authorization in an ASP.NET.
Try following steps for troubleshooting;
1. Verify Redirect URI: Ensure the redirect URI in your application matches exactly with what is configured in your identity provider.
2. Set RedirectUri Property: Explicitly set the RedirectUri in OpenIdConnectAuthenticationOptions to your application's redirect URI.
RedirectUri = "http://localhost:port/signin-oidc"
3. Handle Authentication Failures:
Monitor the AuthenticationFailed event to catch and handle any authentication errors.
Notifications = new OpenIdConnectAuthenticationNotifications
{
AuthenticationFailed = context =>
{
context.Response.Redirect("/Home/Error");
return Task.FromResult(0);
}
};
4. Check Startup Class Configuration: Ensure your Startup class is correctly recognized by OWIN with the [assembly: OwinStartup(typeof(YourNamespace.Startup))] attribute.
5. Review Session and Cookie Settings: Make sure cookies are correctly configured to maintain sessions, especially for mobile browsers.
6. Implement Logging: Add logging throughout the authentication process to identify where the process might be failing.
7. Investigate Mobile-Specific Issues: Since the problem occurs on mobile, look for any mobile-specific settings or behaviors that might be affecting the authentication flow.