Generate Auth URL
Create login intent and get authentication URL.
Endpoint
POST /api/oauth/generate-auth-url?clientId={clientId}
Headers
X-API-Key: your-api-key
Content-Type: application/json
Parameters
Query:
clientId(string, required) - Your application's client ID
Body:
{
"redirectUri": "https://your-app.com/callback",
"state": "random-state-string"
}
| Field | Type | Required | Description |
|---|---|---|---|
redirectUri | string | Yes | Registered redirect URI |
state | string | Yes | CSRF protection (1-500 chars) |
Response
{
"status": true,
"message": "Auth URL generated successfully",
"data": {
"authUrl": "https://dev.reeng.xyz/?intent=550e8400-e29b-41d4-a716-446655440000",
"loginIntentId": "550e8400-e29b-41d4-a716-446655440000"
}
}
Errors
| Status | Message |
|---|---|
400 | Validation failed / Client ID mismatch / Invalid redirect URI |
401 | Invalid API key |
Example
curl -X POST "https://api.reeng.xyz/api/oauth/generate-auth-url?clientId=your-client-id" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"redirectUri": "https://your-app.com/callback",
"state": "random-state-123"
}'
Notes
- Login intent expires in 30 minutes
clientIdmust match API key's applicationredirectUrimust be registered- Use random
statefor CSRF protection