If your application is a regular web app that runs on a server, and requires user authorization, you create a Web app. This option is based on the OAuth 2.0 authorization code grant type. During this flow, users authorize your application before it accesses any resources, and your app retrieves an access token and optionally a refresh token.
You have the required permissions for adding and managing OAuth apps in this Organization. See What Organization roles are available in Tanzu Platform cloud services.
Log in to Tanzu Platform cloud services console.
Click Organization > OAuth Apps, and then click Create New OAuth App.
Select Web app and click Continue.
Register your app by entering the app details:
Type a name and description for the new Oauth app.
Enter at least one redirect URI.
After a user authorizes your client, the authorization server redirects the user back to your client to the URI you specified with an access token. It is best practice to add more than one URI. Use the format http://acme.com.
Specify a time span for your access token.
The default Access Token time to live (TTL) setting is 30 minutes. The maximum value you can set is 300 minutes (five hours). The minimum value you can set is 1 minute.
If you want your access token to authorize requests continuously, select the Issue a refresh token and set Refresh Token TTL value.
The default Refresh Token TTL is 30 minutes. The maximum value you can set is 300 minutes (five hours). The minimum value you can set is 1 minute.
Define scopes.
Scopes provide a way to implement control over what areas in your Organization your client can access - specifically which of your services and the level of permission.
Select the Open ID check box to get information about the users that authorize your app.
Click Create to generate the client credentials.
Copy the credentials or download a JSON file that contains your credentials. You are responsible for storing your credentials in a safe place.
Click Continue.
Paste the credentials into your script.
Parent topic:How do I create OAuth 2.0 apps and authenticate applications