Skip to main content

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​

ParameterRequiredDescription
response_typeYesMust be code.
client_idYesThe URL of your client ID metadata document, or the client_id from Register.
redirect_uriYesOne of your registered redirect URIs. A loopback http URI may use any port.
code_challengeYesBase64url-encoded SHA-256 of your code_verifier, without padding.
code_challenge_methodYesMust be S256.
stateRecommendedAn unguessable value tied to the user's session. Returned unchanged on the redirect.
scopeNoSpace-separated scopes. The only scope is full_access, which is the default.
resourceNoLeave 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
ParameterDescription
codeThe authorization code. Exchange it at Token within 10 minutes; it works once.
stateThe state you sent, if any. Reject the callback if it doesn't match.
issAlways 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
errorWhen
access_deniedThe user clicked Deny.
unsupported_response_typeresponse_type isn't code.
invalid_requestcode_challenge is missing or code_challenge_method isn't S256.
invalid_scopescope contains something other than full_access.
invalid_targetresource 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:

errorWhen
invalid_clientclient_id is missing or unknown, or its metadata document couldn't be fetched or is invalid.
invalid_redirect_uriredirect_uri is missing or isn't one of the client's registered redirect URIs.