Register a new OAuth application on Vultr, link it to an OIDC provider, set callback URLs, and receive the client id and secret through the Vultr API.
An OAuth application lets you authenticate other Vultr customers and call the Vultr API on their behalf, scoped to the permissions they consent to. Registering the application links it to an OIDC provider, defines the callback URLs that receive authorization codes, and returns a client secret used to exchange those codes for access tokens.
Follow this guide to register an OAuth application using the Vultr Console and the Vultr API. The application starts in Draft status and becomes usable by any Vultr customer only after you attach a scope, submit it, and an administrator approves it.
403 Forbidden response. When using the API, create the OIDC provider first by following How to Create an OIDC Provider, then pass its id as oidc_provider_id. In the Vultr Console, the provider is created automatically as part of the application form.
Log in to the Vultr Console.
Click the organization name in the top navigation bar.
Click Manage Organization.
Click OAuth Applications.
Click Create OAuth App.
Enter a name in the Name field. The name is shown to users during authorization and cannot be changed after the application leaves Draft status.
Enter a callback URL in the Callback URLs field and click the + button to add it.
Under Permission Policy, select the policy that defines the application's scope.
Click Create OAuth App.
Click the Copy button next to the Client ID and the Client Secret, then select I have copied these codes in a safe place. The secret is shown only once.
Click Save as Draft to keep the application editable, or Send for Review to submit it for approval.
The application appears in the OAuth Applications list. Saving as a draft keeps it in Draft status, while sending it for review moves it to Pending Review.
Send a POST request to the Create OAuth Client endpoint to register the application. Replace APP-NAME with a user-visible name, CALLBACK-URL with a URL that receives the authorization code, and PROVIDER-ID with your OIDC provider id. Each callback URL must use https://. An http:// URL is allowed only for localhost while the application is in Draft status, otherwise the request returns an HTTP 422 Unprocessable Entity response.
$ curl "https://api.vultr.com/v2/oauth/clients" \
-X POST \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"name": "APP-NAME",
"callback_urls": ["CALLBACK-URL"],
"oidc_provider_id": "PROVIDER-ID"
}'
A successful request returns an HTTP 201 Created response with the application id and a secret. The secret is shown only once and is stored as a hash on the server, so record it immediately. Note the id for future operations.
Send a GET request to the Read OAuth Client endpoint to retrieve the application details. Replace {client-id} with the id from the previous step.
$ curl "https://api.vultr.com/v2/oauth/clients/{client-id}" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Verify that the review_status shows Draft and that callback_urls and oidc_provider_id match your input.