Redirect user to Okta login page through Asp.Net MVC application Skip to main content
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
Vaibhav JoshiVaibhav Joshi 

Redirect user to Okta login page through Asp.Net MVC application


How can we redirect user to Okta login page for authentication? We have referred Okta Music Store application which makes use of Login page within same project but we would like to redirect user to Okta for authentication.

Please suggest.
Thomas KirkThomas Kirk (Okta, Inc.)
You have a few options for application Single Sign On or SSO. The first is WS-Federation ( The second is SAML ( For SAML, check out the SAML library links at the bottom of the page. The third is OIDC (, and it is a good client side only approach.

The last option is Okta API ( which is demonstarted with the music store.
Raphael LondnerRaphael Londner (Okta, Inc.)
Additionally, if you're looking at leveraging some code samples, we suggest that you start looking at more modern authentication methods, namely OpenID Connect.

We have one ASP.NET MVC example that leverages redirection to Okta for authentication with OpenID Connect and it's available at

I also suggest that you take a look at our Early Access documentation page for OpenID Connect at for more information.

We have another sample available at, but that one uses a different OpenID Connect flow (namely the Implicit flow while the previous one uses the Authorization Code flow), as well as our Sign In Widget ( so the authentication is also done transparently in the browser without a redirection to the Okta portal.

If you do want to enable OpenID Connect on your development Okta organization, please contact our developer support at developers at okta dot com and let us know what your dev organization is so we can enable that feature for it.

Vaibhav JoshiVaibhav Joshi
Thanks Thomas and Raphael for the quick reply. We have referred to below ASP.NET MVC demo application.

We are getting an error after updating configuration settings like Client Id, Client Secret, Redirect and Authority and when we try to get authenticated. Unable to corelate reason of error.

Is it because the Okta application which we created (through Okta portal configuration) earlier doesn't support Open Id Connect? When we try to create a new project / application in Okta, we can only see following options. Secure Web Authentication & SAML 2.0

How can we enable this existing application to support Open Id Connect?

Error that we are geeting from Okta : HttpRequestException: Response status code does not indicate success: 500 [IOException: Unable to get document from:https ://{Org} oauth2 /v1/authorize/.well-known/ openid-configuration ] Microsoft.IdentityModel.Protocols.d__0.MoveNext() in c:\workspace\WilsonForDotNet45Release\src\Microsoft.IdentityModel.Protocol.Extensions\Configuration\HttpDocumentRetriever.cs:59