πŸ”‘Authentication

Version: 1.0.0

Description: Learn how to obtain an authentication token from `https://auth.revtek.cloud` for secure API access with scopes.

Obtaining an Access Token with Scopes

To access the API securely with fine-grained access control, you can request an access token with specific scopes. Follow the steps below:

Step 1: Authorization

Start by obtaining authorization from the OAuth2 authorization server while specifying the required scopes in your request:

    
POST /authorize
Host: auth.revtek.cloud
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials
client_id=your_client_id
client_secret=your_client_secret
scope=device:read device:write user:read
    
  

The server will respond with an access token, its expiration time, and the granted scopes:

Step 2: Using the Access Token with Scopes

With the obtained access token and associated scopes, you can make authorized requests to the API. Include the access token in the `Authorization` header of your requests:

The API server will verify the token and check if it has the necessary scope to perform the requested action.

Refreshing the Token with Scopes

Access tokens with specific scopes have a limited lifespan. To continue using the API with the same scope, you may need to refresh the token using the refresh token:

The server will respond with a new access token, its expiration time, and the same scopes.

Revoking Access

If you need to revoke access, contact the authorization server with the token to be revoked:

The authorization server will invalidate the token, preventing further access.

By following these steps, you can securely access the API with specified scopes using OAuth2 authentication provided by `auth.revtek.cloud`.

Last updated