Authorize
Start a sign-in. Send the user's browser here; Arsel shows its consent screen, then redirects back to your redirect_uri with an authorization code. Walkthrough: Sign in with Arsel.
Endpoint
GET https://api.arsel.sa/oauth/authorize
This is a browser redirect, not an API call: no Authorization header.
Query Parameters
| Parameter | Required | Description |
|---|---|---|
response_type | Yes | Must be code. |
client_id | Yes | The URL of your client ID metadata document, or the client_id from Register. |
redirect_uri | Yes | One of your registered redirect URIs. A loopback http URI may use any port. |
code_challenge | Yes | Base64url-encoded SHA-256 of your code_verifier, without padding. |
code_challenge_method | Yes | Must be S256. |
state | Recommended | An unguessable value tied to the user's session. Returned unchanged on the redirect. |
scope | No | Space-separated scopes. The only scope is full_access, which is the default. |
resource | No | Leave it out. It is used by the MCP server, and any value other than the MCP server's URL is refused. |
The user has 30 minutes to sign in, or sign up, and approve before the request expires.
Response
On approval, Arsel redirects with 302 to your redirect_uri:
https://app.example.com/oauth/callback?code=Xq8…&state=af0ifjsldkj&iss=https%3A%2F%2Fapi.arsel.sa
| Parameter | Description |
|---|---|
code | The authorization code. Exchange it at Token within 10 minutes; it works once. |
state | The state you sent, if any. Reject the callback if it doesn't match. |
iss | Always https://api.arsel.sa. Reject the callback if it differs. |
Errors
Once Arsel knows the request came from your app, errors are sent to your redirect_uri as error and error_description, alongside state and iss:
https://app.example.com/oauth/callback?error=access_denied&error_description=The+user+denied+the+request&state=af0ifjsldkj&iss=https%3A%2F%2Fapi.arsel.sa
error | When |
|---|---|
access_denied | The user clicked Deny. |
unsupported_response_type | response_type isn't code. |
invalid_request | code_challenge is missing or code_challenge_method isn't S256. |
invalid_scope | scope contains something other than full_access. |
invalid_target | resource was sent with a value Arsel doesn't accept. |
If Arsel can't trust the redirect_uri, it never redirects. The user stays on an Arsel error page instead:
error | When |
|---|---|
invalid_client | client_id is missing or unknown, or its metadata document couldn't be fetched or is invalid. |
invalid_redirect_uri | redirect_uri is missing or isn't one of the client's registered redirect URIs. |