JWT Authentication 401 problem unity | Community
Skip to main content

JWT Authentication 401 problem unity

  • October 4, 2023
  • 8 replies
  • 0 views

LOKESH11

I follow these two links to sign in using JWT

Building a dedicated JWT endpoint
Adding JWT to the Unity SDK

But after that still i got 401 error,

I need help to fix out these one. Or where am i wrong for that

8 replies

  • October 4, 2023

Hello LOKESH, 

Can you please open a ticket with support@zendesk.com so we can help you further?

We will need more details about your Unity version and your setup.

Thanks,

Gofran


LOKESH11
  • Author
  • October 4, 2023

Gofran, trying to reach you guys through email also, but it says no longer valid. 
I hope you guys will help me in trial mode, so that i can go for purchase later. 


  • October 4, 2023

yeah apologies you have to follow the instructions in Option 2 in this article.

Once you reach out to support I will be able to access your details and hopefully solve your issue.

 


LOKESH11
  • Author
  • October 4, 2023

can you tell way to generate user token in unity engine.


  • October 4, 2023

The client supplies the user token, but the actual JWT challenge and response occurs between the backend servers. if you place a JWT into the client-side SDK code. That is not supported and you may encounter unexpected results

Please take a look at these examples: https://github.com/zendesk/zendesk_jwt_sso_examples


LOKESH11
  • Author
  • October 4, 2023

thats fine but i am taking about token as string value that we pass in function. Please check ref link:

https://developer.zendesk.com/documentation/classic-web-widget-sdks/unity-native-sdk/unity-sdk/jwt_authentication/


  • October 4, 2023

Yes! I understand.

As an integrator, you should be the one providing the token by providing a specific ID to the JWT algorithm, something like this: 

let token = Identity.createJwt(token: "unique_db_user_identifier")

More info here 


LOKESH11
  • Author
  • October 5, 2023

you saying i should provide unique db user identifier 

But as per link say
https://developer.zendesk.com/documentation/classic-web-widget-sdks/support-sdk/working-with-the-support-sdk/building-a-dedicated-jwt-endpoint-for-the-support-sdk/?_ga=2.113071239.2078965967.1696310573-1682907315.1695877410#request-format

 

it should be some secure_token_provided_by_the_app
can you clarify that which one should we pass and if i have to give secure token than from where we should generate