How to do authorisation code flow programmatically?

Hi,

We are trying to find a way of doing the authorisation code flow without having to open a browser window and enter the credentials in the login page. We want to be able to do this for our automated tests.

I was hoping there was an endpoint we could send a request to and get a code returned but i could not find anything like that in the docs.

There is an endpoint exposed to retrieve a token but we want the front end to only ever see the code so this flow is preferable.

if its not possible then we will use selenium etc to grab what we need.

Thanks for your help!

Hi @hugh.livingstone

The authorization code flow is a redirect flow that always relies on the user interaction. If you’re trying to automate testing in the backend, the best option is to create a user account for your software and use the Resource Owner Password Credentials Grant, as shown here:

1 Like

Thanks for helping on this one Ricardo!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.