I want to setup Apigee deployment task in CD pipeline in VSTS.
Ref: https://apidocs.apigee.com/api-reference/content/using-oauth2-security-apigee-edge-management-api
There are two ways to access Management API... 1. Basic Auth 2. OAuth2.
Easy option is to use Basic Auth in the CD ie create a new user specifically for automation work and put its username and password in the release definitions in VSTS, but from security perspective its not safe. So we decided to go with OAuth2 approach.
Refering to the above doc, I see that the tokens generated by (https://login.apigee.com/oauth/token) have fix TTL ie 30 mins and the refresh token has TTL of 24 hours. But for automation, I want to generate tokens with long TTL say 1 year, so that I do not have to go and update tokens everyday in VSTS or any build server.
So is there any way to generate tokens with custom TTL for Management API?