Customer Self-Service Portal

How to get access token for automation purpose

I am writing an automation which will automate all manual tasks like creation of user from particular customer, adding pagerduty from specific customer etc. One of the requirement is that this automation should authenticate and authorize the user who is running this automation. This is how my automation will run.

 

/usr/bin/python automation.py –operation useradd –customername customer1 –userdata ‘anuj:mailto:anujk@vmware.com’ –username anujk –password ‘password’

 

What have I done so far:

  1. Created one small flask web application. Logged in site24x7 api console and create web client as application. Provided name, callback url etc. It gave me client ID and secret
  2. Open web app in browser and click on authorize hyperlink. This will give access token.

 

Step2 is manual activity and I don’t want to use selenium because automation user may not have selenium python package installed. Therefore, I want to avoid step 2.

 

Automation should work as follow.

 

  1. Automation should take credential as input
  2. It should make a curl call which should yield access token

I want to achieve step2.

 

any help will be much appreciated.