Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Okta integration with ASP net zero application #9864


User avatar
0
huntethan89 created

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version? 6.8.0
  • What is your product type (Angular or MVC)? MVC
  • What is product framework type (.net framework or .net core)? .net framework

I am trying to integrate Okta SSO with Aspnetzero and I am getting below error: -

IDX21323: RequireNonce is 'System.Boolean'. OpenIdConnectProtocolValidationContext.Nonce was null, OpenIdConnectProtocol.ValidatedIdToken.Payload.Nonce was not null. The nonce cannot be validated. If you don't need to check the nonce, set OpenIdConnectProtocolValidator.RequireNonce to 'false'. Note if a 'nonce' is found it will be evaluated.

I have taken the reference from the below URL: - https://developer.okta.com/blog/2019/03/11/build-a-crud-app-with-aspnet-mvc-and-entity-framework The sample code works fine. However, when I try to integrate the code with Aspnetzero I am getting error.

Below the code I am using: - In startup file under configuration I have added: -

When I run the code it redirects me to the okta login. But when I try to login I am getting error mentioned above.

Below are the settings that I have done in my okta account application:

Please let me know what i am missing.

Thanks


4 Answer(s)
  • User Avatar
    0
    musa.demir created

    Hi @smartlayer Your problem looks like a cookie problem. If you check that forum report, they say that it is not happening on production which published with https. And they also provide a solution to use in the development process.

  • User Avatar
    0
    huntethan89 created

    After login using Okta SSO I am getting below error:

  • User Avatar
    0
    huntethan89 created

    We are able to receive success response from OKTA however it is not getting mapped to application user. Following code always return null.

    var loginInfo = await _authenticationManager.GetExternalLoginInfoAsync();

    What is it looking for and how can we resolve it?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @smartlayer

    If this method fails somehow, you should get the error message below;

    Could not get information from external login.

    Can you debug the source code and see where it fails in ExternalLoginCallback ?