POST Authorize/OAuth
Obtains an authorization token. The Venafi Authorization End Point (VEDauth) returns a bearer access token and other information.
CAUTION As with all tokens and credentials, you should secure your bearer tokens. Do not share tokens with other users or applications. If necessary, you can call GET Revoke/Token, and then retry this API call.
Prerequisites
You must define an API Application Integration in Aperture and give the caller access. In this API call, use the scope, privilege, and Application ID as the client id. For more information, see Setting up token authentication.
Required Permissions
The caller is not required to have any special permissions.
Headers
-
Content type: For example, Content-Type:application/json.
- No bearer access token is necessary for this API call.
Parameters
In the request URL, specify vedauth. For example, POST https://tpp.venafi.example/vedauth/authorize/oauth. All parameter names are case sensitive.
Name |
Description |
---|---|
The application ID identifies an integration, application, or client that uses this REST API. Use the same values that appear in the Aperture configuration settings for the API Applications Integration. For example, use the Application ID as the client_id. For more information, see Creating API application integrations.
|
|
password |
The API caller's password, which is already set in the local, AD, or LDAP identity provider. |
scope |
The set of scope and privilege restrictions that match all of the requirements for the various API calls your application makes. Be sure to set the various scopes you need with settings from the Aperture Configuration for API Application Integration. The settings must match the method requirements in the Token auth map. Otherwise, when you pass the token with your API calls, the calls may fail. For more information, see Token Auth scope and Token Auth privilege restrictions. Specify each scope followed by the privilege, if any:
|
state |
(Optional) A session state, redirect URL, or random string to prevent Cross-Site Request Forgery (CSRF) attacks. |
username |
The API caller's username, which is already set in the local, AD, or LDAP identity provider. Valid formats:
|
Returns
For invalid requests, this method returns Error and a message.
On success, the Authorization server returns a HTTP 200 and the following data that applies to the Trust Protection Platform user.
Name |
Description |
---|---|
HTTP 200 |
For valid requests, Authorize/Oauth returns a HTTP 200 message; and the following data:
|
HTTP 400 |
Invalid requests return a HTTP 400; it includes one of the following statuses.
|
HTTP 401 |
If there are authentication errors, this API call returns a HTTP 401; it includes one of the following:
|
HTTP 403 |
|
Example: Use the correct scope; get a bearer token
Request
POST https://tpp.venafi.example/vedauth/authorize/oauth { "client_id":"MyApp", "username":"Admin" "password":"$WebSDKPassword", "scope":"Certificate:discover,manage,delete", "state":"r9GN3vFOwjslBPsyiuB6OA==" }
Response
HTTP/1.1 200 OK { "access_token":"zmbVaygOBFtFV8TlUW9lqg==", "refresh_token":"HKBOMauZqglTwy2odNKlCw==", "expires_in":7775999, "expires":1618855359, "token_type":"Bearer", "scope":"codesign:admin,approve,delete,manage", "identity":"local:{de3944a8-3479-4450-b412-0dacd642017d}", "refresh_until":1642615359 }