Search code examples
asp.net-coreopenid-connectclient-sideopeniddict

Problem with OpenIdDict on client side regarding the Redirect_Uri


I am using OpenIdDict but having trouble with redirect_uri which stored in my database. The redirect_uri entry in my database is signin-oidc but don't know why have error shown below.

   The request address matched a server endpoint: Authorization.
info: OpenIddict.Server.OpenIddictServerDispatcher[0]
      The authorization request was successfully extracted: {
        "client_id": "console",
        "redirect_uri": "https://localhost:6001/signin-oidc",
        "response_type": "code",
        "scope": "openid profile",
        "code_challenge": "Nr0Jgf4cY3jUtC_1w3GwZ2ryR5FeYoSWrYpu7VF2nxQ",
        "code_challenge_method": "S256",
        "response_mode": "form_post",
        "nonce": "637773059511435225.Y2ZkMDY4MzctYjczNi00MmFlLWFiNjEtMmJlOWI1NDllMzNjOTYxY2Q1MmQtNDcyOS00N2RmLTgyZTQtZDg4Yjc0ZDk5ODk4",
        "state": "CfDJ8NYwebNNwH9FkusxDMvbzdrGCOwob0ZBYnanAjf_cGnDjOjF-VnCxbzK8hxyodvDee-v7Sh2Ny4zKhbjOZZZEzSKi-ebQCROJYha2GUiUxbDpvX34Drs-ehjMozt68GkY2ETu_GIf-vRr7Ij4KXaSeUeq5bZioLyJI97kf79txzv700HeEQxxK_unsvj8n8s4fOELMx9dRydCBV0Yw26jROlb-_qjhP9cL1pALEoZ2xeotAl8LY9FZjUDuOuHZSknK-GGFUIhT34-rJ_Wg71MncO-Mat__6m_ISNkr7BIti6qf9qPnLcrTeW-eg6Y_9IK8W_G59ChO1-wwD5Q1A68F086xzGVEvkPLeH1HCGFi0BceBRjRI_Efer9yWJn3pzow",
        "x-client-SKU": "ID_NETSTANDARD2_0",
        "x-client-ver": "6.11.1.0"
      }.
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
      An unhandled exception has occurred while executing the request.
      System.Text.Json.JsonReaderException: 'h' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.
         at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)
         at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker)
         at System.Text.Json.Utf8JsonReader.ReadFirstToken(Byte first)
         at System.Text.Json.Utf8JsonReader.ReadSingleSegment()
         at System.Text.Json.Utf8JsonReader.Read()

Solution

  • i realized the redirect_urls is an array stored in the database not a single redirect url.