I have a task which need to call an external Oauth2 API to get data.
The authentication steps of this API is:
- Request an application authentication:
https://api.apiname/v1/oauth?app_id= [value] & redirect_url = [value] & response_type = [value] & scope = [value] & state = [value]
-> It will redirect to the login page of this API
- Login then get the code
- Use that code then request to get an access token:
https://api.apiname/v1/token?grant_type=oauth_code&app_id=[value]&secret=[value]&code=[value]
- Use received access token to call specific API to get data.
So how can I get through step 1,2,3 automatically in my system because the client should not have to log in to API to get the code? Is there a way I can go through step 1 without showing login page?