Authorization-code/callback throw exception after login

Hi,

I have created app of OIDC with web App with 2F and its implemented in local machine and working fine in local but when its deploy on server then page is stuck ‘authorization-code/callback’.
I implemented both code one by one as below

  1. public void Configuration(IAppBuilder app)
    {
    app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);

        app.UseCookieAuthentication(new CookieAuthenticationOptions());
    
        app.UseOktaMvc(new OktaMvcOptions()
        {
            OktaDomain = ConfigurationManager.AppSettings["okta:OktaDomain"],
            ClientId = ConfigurationManager.AppSettings["okta:ClientId"],
            ClientSecret = ConfigurationManager.AppSettings["okta:ClientSecret"],
            AuthorizationServerId = ConfigurationManager.AppSettings["okta:AuthorizationServerId"],
            RedirectUri = ConfigurationManager.AppSettings["okta:RedirectUri"],
            PostLogoutRedirectUri = ConfigurationManager.AppSettings["okta:PostLogoutRedirectUri"],
            GetClaimsFromUserInfoEndpoint = true,
            Scope = new List<string> { "openid", "profile", "email" },
        });
    }
    

For Reference : https://github.com/okta/samples-aspnet-webforms/tree/master/okta-hosted-login/okta-aspnet-webforms-example

  1. public void ConfigureAuth(IAppBuilder app)
    {

app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);

app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);

app.UseCookieAuthentication(new CookieAuthenticationOptions());

app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions

{

ClientId = _clientId,

ClientSecret = _clientSecret,

Authority = _authority,

RedirectUri = _redirectUri,

ResponseType = OpenIdConnectResponseType.CodeIdToken,

Scope = OpenIdConnectScope.OpenIdProfile,

TokenValidationParameters = new TokenValidationParameters { NameClaimType = "name" },

Notifications = new OpenIdConnectAuthenticationNotifications

{

  AuthorizationCodeReceived = async n =>

  {

   .......
   .........
   ........

Still issue is not resolved on server. Is any changes required on server(IIS)?

Hello,
When you test on a deployed server are you using http or https?
Anything other than localhost (127.0.0.1) will require https.