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:firstname.lastname@example.org’ –username anujk –password ‘password’
What have I done so far:
- 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
- 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.
- Automation should take credential as input
- It should make a curl call which should yield access token
I want to achieve step2.
any help will be much appreciated.