Does your API require 3-leg authentication? With the help of a small helper container you can achieve automation of 3-leg using the API Fortress platform.
Thanks to the helper, your local machine can help in the automation of your tests logging in using 3-leg auths such as Facebook, Twitter, and Google.
First let's deploy the helper container, which can be found at the below link: https://github.com/apifortress/3loa
Once you have the 3loa folder downloaded, navigate to that folder within a terminal window. Then run the following command to start the 3loa container: "sudo docker-compose up -d"
The 3-leg helper is now live and can be access from API Fortress using the following URL:
Now that we have that up and running, watch the short video below to learn how to use this in API Fortress to automate your 3-leg OAuth:
In the example used in the video above, we show how to call the 3loa API with details to execute the authentication and return the access token. Below are some callouts from that example:
POST Body Output#
The post body of the API call will need the following details:
usernamefor logging in
passwordfor logging in
x-pathselector for username field
x-pathselector for password field
x-pathselector for the login button
x-pathselector for the authorize button
URLto authorize site
URLused to get access token
x-pathselectors will need to match the site used for authorization.
Please note that this is an open source tool if your authorization flow differs from the example provided, you can download the source code of the tool and modify it to achieve the flow needed for your specific flow.