Overview
RocketSkip uses OAuth 2.0 to provide secure and scalable authentication and authorization for accessing its APIs. This guide outlines how to integrate OAuth 2.0 into your application to authenticate users and access RocketSkip’s services.OAuth 2.0 Grant Types Supported
RocketSkip supports the following OAuth 2.0 grant types:- Authorization Code Grant: Best suited for web and mobile applications.
- Refresh Token Grant: Used to obtain a new access token without requiring the user to log in again.
Authentication Flow
1. Obtain Authorization Code
For applications using the Authorization Code Grant, redirect users to RocketSkip’s authorization endpoint:response_type
: Must becode
.client_id
: Your application’s client ID.redirect_uri
: The URL where RocketSkip will redirect after authorization.scope
: Space-separated list of permissions.state
: A unique identifier to prevent CSRF attacks.
redirect_uri
with an authorization code.
2. Exchange Authorization Code for Access Token
To obtain an access token, send a POST request to RocketSkip’s token endpoint:3. Access RocketSkip API
Use the access token to make authenticated API requests:4. Refreshing the Access Token
To refresh an expired access token, send a request with the refresh token:Client Credentials Grant (Machine-to-Machine Authentication)
For server-to-server communication, use the Client Credentials Grant:Security Considerations
- Always use HTTPS to prevent token interception.
- Store
client_secret
securely and never expose it in front-end applications. - Use the
state
parameter in authorization requests to prevent CSRF attacks. - Access tokens should be short-lived; use refresh tokens to maintain sessions securely.
Error Handling
If a request fails, RocketSkip will return an error response:invalid_request
: Missing or malformed parameters.invalid_client
: Invalid client credentials.invalid_grant
: Authorization code or refresh token is invalid.unauthorized_client
: The client is not authorized for the requested grant type.access_denied
: The user denied the request.