1. Vijay Kumar
  2. PowerServer
  3. Thursday, 23 November 2023 08:54 AM UTC

Hi Team,

 

 I need to take jwt response from other system API, from which i need to get user details and roles, I am succeeded to decode the jwt token info in PowerBuilder, however i am not able to get the values from  the decoded string , can any one help on this.

 

Regards,

Vijay.

mike S Accepted Answer Pending Moderation
  1. Thursday, 23 November 2023 16:19 PM UTC
  2. PowerServer
  3. # 1

i would use an online decoder first (such as Free Online Decode JWT (JSON Web Tokens) (jwtdecode.com) ) so you can see what is in the JWT. 

 

but is sounds like your problem is that you are having problems loading the json parser with the returned values and not the JWT itself?

 

 

 

 

Comment
There are no comments made yet.
Tracy Huang @Appeon Accepted Answer Pending Moderation
  1. Thursday, 23 November 2023 09:34 AM UTC
  2. PowerServer
  3. # 2

Hi Vijay, maybe the code example in this page is of some help?

https://docs.appeon.com/ps2022r2/Add_scripts_for_JWT.html

 

Regards

Tracy Huang

Comment
  1. Vijay Kumar
  2. Thursday, 23 November 2023 10:31 AM UTC
Hi Tracy Huang,



Thanks for your quick reference, however i done all these steps, Actually i need to read the access token data like user claims etc., for this i have done the base64 decoder after that i got all the access token data , even though it is in json format but we could not able to load the string to json parser because of the root must not followed followed by other values error i could i resolve this issue.

Your reply will be much appreciated.

Thank you !

Vijay.

  1. Helpful
  1. Tracy Huang @Appeon
  2. Friday, 24 November 2023 01:48 AM UTC
Hi Vijay,

The string to be loaded by JSONParser must be a JSON file or JSON string in the standard JSON format. Please validate the JSON format first using a third-party tool (such as any online JSON validator and formatter).

And also please take a look at the documentation and code examples of JSONParser LoadString here: https://docs.appeon.com/pb2022r2/powerscript_reference/loadString_func.html

Regards

Tracy
  1. Helpful
  1. Tracy Huang @Appeon
  2. Friday, 24 November 2023 02:12 AM UTC
Vijay, you may post a sample of the decoded string, I can have engineers look into it.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.