# Okta login redirect to asp.net error page

**URL:** <https://devforum.okta.com/t/okta-login-redirect-to-asp-net-error-page/22956>\
**Category:** OAuth/OIDC\
**Tags:** dotnet\
**Created:** [January 5, 2023, 6:42am UTC](https://devforum.okta.com/t/okta-login-redirect-to-asp-net-error-page/22956 "2023-01-05T06:42:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![teenajohn](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@teenajohn](https://devforum.okta.com/u/teenajohn)\
**Post date:** [January 5, 2023, 6:42am UTC](https://devforum.okta.com/t/okta-login-redirect-to-asp-net-error-page/22956/1 "2023-01-05T06:42:52Z")

</div>

Hi ,  
I am a new bie to Okta. I have application developed in [asp.net](http://asp.net) core razor pages,where i am using Okta login authentication. Tried to make necessary changes to the [asp.net](http://asp.net) core 6 mvc example given in Github. The issue that i am facing is once i login the page navigates to default error page in [asp.net](http://asp.net) core. I am stuck at this part. Appreciate your help to figure out this issue. Thanks in Advance

Regards,  
Teena John

---

<div class="post-metadata">

**Author:** ![louie](https://avatars.discourse-cdn.com/v4/letter/l/c68b51/32.png) [@louie](https://devforum.okta.com/u/louie)\
**Post date:** [January 5, 2023, 2:37pm UTC](https://devforum.okta.com/t/okta-login-redirect-to-asp-net-error-page/22956/2 "2023-01-05T14:37:29Z")

</div>

Could you please provide a link to the sample application you are using?

---

<div class="post-metadata">

**Author:** ![teenajohn](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@teenajohn](https://devforum.okta.com/u/teenajohn)\
**Post date:** [January 6, 2023, 12:26am UTC](https://devforum.okta.com/t/okta-login-redirect-to-asp-net-error-page/22956/3 "2023-01-06T00:26:12Z")

</div>

Hi louie,thanks for your reply!  
Its an intranet application.

When i changed the highlighted if condition it was redirecting to home page. But from home page when i access other pages its showing the error page.

public IActionResult OnPostAsync(string sessionToken)  
{  
_**if (HttpContext.User.Identity.IsAuthenticated)**_  
{  
var properties = new AuthenticationProperties();  
properties.Items.Add(“sessionToken”, sessionToken);  
properties.RedirectUri = “/Home”;

```
            return Challenge(properties, OktaDefaults.MvcAuthenticationScheme);
        }

        return RedirectToPage("/Home");
    }

```

---

<div class="post-metadata">

**Author:** ![teenajohn](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@teenajohn](https://devforum.okta.com/u/teenajohn)\
**Post date:** [January 9, 2023, 2:07am UTC](https://devforum.okta.com/t/okta-login-redirect-to-asp-net-error-page/22956/4 "2023-01-09T02:07:20Z")

</div>

Hi Team,

Any help on this! i am really stuck at this part. Everything works fine in my localhost, There was no error. when i navigate to other pages.

Thanks,  
Teena John

---

<div class="post-metadata">

**Author:** ![teenajohn](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@teenajohn](https://devforum.okta.com/u/teenajohn)\
**Post date:** [January 9, 2023, 4:16am UTC](https://devforum.okta.com/t/okta-login-redirect-to-asp-net-error-page/22956/5 "2023-01-09T04:16:32Z")

</div>

Hi Team,

Could some one clarify me on this error

`MissingMethodException: Method not found: 'Boolean Okta.AspNet.Abstractions.OktaParams.IsPromptEnrollAuthenticator(System.Collections.Generic.IDictionary`2\<System.String,System.String\>)'.`

---

<div class="post-metadata">

**Author:** ![louie](https://avatars.discourse-cdn.com/v4/letter/l/c68b51/32.png) [@louie](https://devforum.okta.com/u/louie)\
**Post date:** [January 9, 2023, 8:38pm UTC](https://devforum.okta.com/t/okta-login-redirect-to-asp-net-error-page/22956/6 "2023-01-09T20:38:00Z")

</div>

Which version of .NET and the Okta SDK are you using?

---

<div class="post-metadata">

**Author:** ![teenajohn](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@teenajohn](https://devforum.okta.com/u/teenajohn)\
**Post date:** [January 10, 2023, 12:09am UTC](https://devforum.okta.com/t/okta-login-redirect-to-asp-net-error-page/22956/7 "2023-01-10T00:09:21Z")

</div>

[Asp.net](http://Asp.net) core 6 and Okta.AspNetCore 4.4.1 SDK

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 12, 2024, 11:04pm UTC](https://devforum.okta.com/t/okta-login-redirect-to-asp-net-error-page/22956/8 "2024-02-12T23:04:36Z")

</div>


