How to get access token dynamically using code

Hi, When I run my code in Azure Pipeline, it is failing… I guess, pipeline is not taking desired capabilities set by us (pageLoadStrategy to “none” in Desired Capabilities settings).

Can you help

Hi @gopabandhu.patra,
Can you share the command to run Katalon in Azure Pipeline?

Please ignore… I have fixed it… There is a config issue in machine.

BTW, if the Grant type “Authorization code” then how dynamically capture token?

Any help on “BTW, if the Grant type “Authorization code” then how dynamically capture token?”

Hi @gopabandhu.patra,
Can you clarify your use case?

Earlier I was using Grant type= Implicit. You gave the solution for that to capture runtime the token.
Now, How can I capture token if Grant type =“Authorization code”?

Hi @gopabandhu.patra,
I will get back to you with a sample project for this. Please stay tuned.

1 Like

any suggestion?

Please help

will it take time?

Let me know if you are unable to give solution. I need to ask someone else…

Hi @gopabandhu.patra,
Still working on the sample project for you. Please stay tuned.

Hi @gopabandhu.patra,
Please find in the attachment the sample project for getting access token dynamically with authorization code grant type. To be able to run the sample project, you must:

  • Sign up for an account on Register - Imgur.

  • Navigate to Sign In - Imgur to generate a client id and a client secret.

  • Open the sample project, in the default profile, enter the generated client id and client secret to the corresponding global variables. Also, enter the username and password that you have registered on Imgur.

  • Run the only sample test case and observe the printed access token.

Also, you can also read the code without executing the test and grasp the idea on how to get an access token dynamically.
OAuth2_Implicit_1 2.zip (127.9 KB)


am getting above error while sign in to
Imgur

any commenta?

Hi @gopabandhu.patra,
It’s not an issue. Just proceed to enter the information for generating a new client.

am unable to add the client. it is loading error page. can you give your data so that i can try as i can see this is testing website?

please help…

Need it urgently

Hi, can you record a gif or a video, it’s difficult to help without more contexts.