Fortinet black logo

REST API Solution Guide

OAuth server verify token (/oauth/verify_token/)

OAuth server verify token (/oauth/verify_token/)

URL: https://[server_name]/api/v1/oauth/verify_token/?client_id=<client_id>

This endpoint is used to verify an access token to determine if it is valid. Returns an HTTP 200 OK response and the associated username if the token is valid.

Supported fields

Field Display name Type Required Other restrictions
client_id String ID of client or application string Yes Must be present as a query parameter

Allowed methods

HTTP method Resource URI Action

Note

GET /api/v1/oauth/verify_token/?client_id=<client_id> Verify specified token

The access token must be placed in the Authorization header of the request in this format: 'Authorization: Bearer [ACCESS_TOKEN]'

Response codes

In addition to the general codes defined in General API response codes, a POST request to this resource can also result in the following return codes:

Code Response content Description
200 OK Username is returned upon success Token was successfully verified
401 Unauthorized. Token is not valid.

Example

Verify a Token:

curl -k -v -X GET \

https://[FAC_IP]/api/v1/oauth/verify_token/ \

-H 'Content-Type: application/json' \

-H 'Authorization: Bearer Ua3tkmlDtePw7EQIXb1a2oGNkw4Li'

Response:

200 OK

OAuth server verify token (/oauth/verify_token/)

URL: https://[server_name]/api/v1/oauth/verify_token/?client_id=<client_id>

This endpoint is used to verify an access token to determine if it is valid. Returns an HTTP 200 OK response and the associated username if the token is valid.

Supported fields

Field Display name Type Required Other restrictions
client_id String ID of client or application string Yes Must be present as a query parameter

Allowed methods

HTTP method Resource URI Action

Note

GET /api/v1/oauth/verify_token/?client_id=<client_id> Verify specified token

The access token must be placed in the Authorization header of the request in this format: 'Authorization: Bearer [ACCESS_TOKEN]'

Response codes

In addition to the general codes defined in General API response codes, a POST request to this resource can also result in the following return codes:

Code Response content Description
200 OK Username is returned upon success Token was successfully verified
401 Unauthorized. Token is not valid.

Example

Verify a Token:

curl -k -v -X GET \

https://[FAC_IP]/api/v1/oauth/verify_token/ \

-H 'Content-Type: application/json' \

-H 'Authorization: Bearer Ua3tkmlDtePw7EQIXb1a2oGNkw4Li'

Response:

200 OK