133
Views
5
Comments
Solved
verify token from REST API
Application Type
Mobile

Hi All,

My name is Yansen, im new using outsystems and i still learning 

I have API to verify token , the token was generated when user login then stored to entitiy, so after stored i need to consume it for verify process. 

verify process needed to consume other API like this example (request need token) ,  how can i achieve this in outsystems ? I share my testing oap, please let me know if anyone figure it out to solve this

Best Regards,

Yansen


JWT.oap
UserImage.jpg
vikas sharma
Champion
Solution

so on screen load, you can call the data action to get the data from API. In this api call you will pass the token fetched from database. Please find attached updated oml. In this on Screen1, I am calling the PostGetUserTicket api using token stored for user.

regards

JWTNew.oml
UserImage.jpg
yosua yansen

Hi mr @Vikas Sharma 

thanks you, its worked, 

UserImage.jpg
vikas sharma
Champion

Hi Yansen,

If you have saved the token on login in the database, then before API calling you just need to get the token from database and pass it into the API. Exactly what issue you are facing in this. Are you facing issue to pass this token into the API ?

regards

UserImage.jpg
yosua yansen

Hi @Vikas Sharma 

thank you for your response, yes i facing issue to pass this token into the API 

UserImage.jpg
vikas sharma
Champion
Solution

so on screen load, you can call the data action to get the data from API. In this api call you will pass the token fetched from database. Please find attached updated oml. In this on Screen1, I am calling the PostGetUserTicket api using token stored for user.

regards

JWTNew.oml
UserImage.jpg
yosua yansen

Hi mr @Vikas Sharma 

thanks you, its worked, 

UserImage.jpg
dan liu

I want to look at your testing aop for reference, both rest api expose and consume module, can you attach it? if possible, thankyou very much. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.