OAuth Endpoints
Complete reference for TinyRebrand's OAuth 2.0 authentication endpoints
TinyRebrand's OAuth 2.0 implementation provides secure authentication and authorization. These endpoints handle token generation, user authorization, and token management.
Personal Access Tokens (PATs): For simpler integrations, you can also use Personal Access Tokens. PATs are long-lived tokens that don't require the OAuth flow. You can create and manage them through the Token Management API.
Available Endpoints
Complete list of OAuth endpoints and their purposes:
| Endpoint | Method | Purpose | Required Scope |
|---|---|---|---|
/oauth/token | POST | Exchange credentials for tokens | None (public) |
/oauth/authorize | GET/POST | Authorization flow | None (public) |
/oauth/google | POST | Google SSO | None (public) |
/oauth/revoke | POST | Revoke tokens | None (public) |
/oauth/introspect | POST | Validate tokens | None (public) |
/oauth/tokenExchange credentials for access tokens
Exchange credentials for access tokens using password grant.
Request
curl -X POST https://api.tinyrebrand.com/api/oauth/token \
-H "Content-Type: application/json" \
-d '{
"grant_type": "password",
"client_id": "web-client",
"username": "[email protected]",
"password": "password123"
}'Request Body
Response 200
{
"status": 200,
"code": "OK",
"message": "Login successful",
"data": {
"access_token": "at_1234567890abcdef",
"refresh_token": "rt_abcdef1234567890",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "user:read links:read links:write",
"user": {
"id": "user123",
"email": "[email protected]",
"name": "John Doe"
},
"limits": {
"domains": { "used": 2, "limit": 3 },
"links": { "used": 150, "limit": 500 }
}
}
}/oauth/googleGoogle Sign-In authentication
Authenticate using Google Sign-In.
Request
curl -X POST https://api.tinyrebrand.com/api/oauth/google \
-H "Content-Type: application/json" \
-d '{
"token": "google_id_token_here",
"client_id": "web-client"
}'Request Body
Response 200
{
"status": 200,
"code": "OK",
"message": "Google login successful",
"data": {
"access_token": "at_google_1234567890abcdef",
"refresh_token": "rt_google_abcdef1234567890",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "user:read links:read links:write",
"user": {
"id": "user123",
"email": "[email protected]",
"name": "Google User"
}
}
}/oauth/revokeRevoke access or refresh tokens
Revoke access or refresh tokens.
Request
curl -X POST https://api.tinyrebrand.com/api/oauth/revoke \
-H "Content-Type: application/json" \
-d '{
"token": "at_1234567890abcdef",
"token_type_hint": "access_token"
}'Request Body
Response 200
{
"status": 200,
"code": "OK",
"message": "Token revoked successfully",
"data": {
"revoked": true
}
}/oauth/introspectValidate token and get metadata
Validate token and get metadata.
Request
curl -X POST https://api.tinyrebrand.com/api/oauth/introspect \
-H "Content-Type: application/json" \
-d '{
"token": "at_1234567890abcdef"
}'Request Body
Response 200
{
"status": 200,
"code": "OK",
"message": "Token introspected successfully",
"data": {
"active": true,
"token_type": "Bearer",
"scope": "user:read links:read",
"client_id": "web-client",
"username": "[email protected]",
"exp": 1719936000
}
}