Search Unity

Question "Failed to parse JWT token"

Discussion in 'Authentication' started by tia25, Dec 21, 2022.

  1. tia25

    tia25

    Joined:
    Oct 6, 2017
    Posts:
    4
    Hello, I'm calling "External Token Sign In" using UAS Authentication REST API and getting:

    Response (403):
    JSON(
    {"title":"UNAUTHORIZED_REQUEST","detail":"Failed to parse JWT token","details":[],"status":403}

    It works fine when called from Postman but I'm using Unreal Engine (please don't hurt me) to call this request. All the other Unity API requests requiring UAS id token (when taken from Postman) are working fine, except this one.

    Any ideas what could be at fault?


    Could it be that the data-raw requirement is not being met as I'm sending the token value as the JSON Object in the request parameters? (that's my only option)

    Any help would save my life!
     
  2. randyl_unity

    randyl_unity

    Unity Technologies

    Joined:
    Aug 22, 2019
    Posts:
    7
    Hi!

    Thanks for reporting the issue! I have a few quick questions:
    • What external id provider are you trying to connect to?
    • I need a little bit further clarification on `I'm sending the token value as the JSON Object in the request parameters`. What exactly are you passing into the token field? Are you passing in a token retrieved from an external Id Provider (i.e Google) or are you passing in a UAS id token?

    Thank You!
     
  3. tia25

    tia25

    Joined:
    Oct 6, 2017
    Posts:
    4
    Cordially thank you for responding! I managed to get it working - specifying the "Content-type" header as "application/json" (even though that's the default type anyway) seems to have done the trick.

    I'm using Facebook as an external OpenID provider and can't wait to start using Unity Relay (many many thanks for making it engine agnostic!).

    "External Token Sign In" sometimes returns:
    LogHttp: Warning: 00000882F0AFB900: request failed, libcurl error: 56 (Failure when receiving data from the peer)


    In which case REST Result won't print any JSON response (I can only see it in the console but is there a way to retrieve it in code?) and I would need to call the Sign In method again but I guess we can live with that.

    On a side note, please allow to delete test UAS accounts from the dashboard, otherwise a bunch of them get orphaned and someone still has to pay for server storage, right?

    Finally, if you released a product on Unreal Marketplace that refers to Unity Relay, people would flock in herds to use it because it is so unintuitive to check anything that another game engine is offering, just my two cents.