Authorization URL parameters: what to send and why
In one line: authorization_endpoint, client_id, redirect_uri, response_type, scope, state, nonce, prompt and code_challenge, with a complete example URL.
An authorization request is just a URL. Send the browser there and the server authenticates the user, collects consent and redirects back to redirect_uri. Understanding each parameter is the fastest way to explain a missing login screen or an invalid_request error.
Required parameters
| Parameter | Role | Notes |
|---|---|---|
response_type | Kind of response wanted | code for the authorization code flow. token is implicit, removed in OAuth 2.1. |
client_id | Client identifier | A public value, not a secret. |
redirect_uri | Where the response goes | Must equal the registered value character for character. |
scope | Requested permissions | Space separated; encoded as %20 or +. |
state | CSRF protection | Fresh random value per request, compared on the callback. |
What OIDC adds
Adding openid to scope makes it an OIDC request and the token response includes an ID token. Send a nonce and compare it with the ID token claim to stop replay. profile and email are standard scopes for user claims.
https://idp.example.com/oauth2/authorize ?response_type=code &client_id=oidc-demo-client &redirect_uri=https%3A%2F%2Fapp.example.com%2Foidc%2Fcallback &scope=openid%20profile%20email &state=8f14e45fceea167a5a36dedd4bea2543 &nonce=6f1ed002ab55 &code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM &code_challenge_method=S256 &prompt=consent
Optional parameters
prompt—none,login,consent,select_account.nonecannot be combined.login_hint— email or phone hint. Always encode user-supplied values.response_mode—query,fragmentorform_post. Apple commonly requiresform_post.max_age— maximum authentication age in seconds.audience— API resource identifier (Auth0 and others).
Encoding rules
Encode values like encodeURIComponent does. A redirect_uri encodes its colon and slashes too, ending up as https%3A%2F%2F.... Hand-built string concatenation breaks when a redirect_uri contains & or #, so use the URL API or URLSearchParams.
Provider differences
- Google —
access_type=offlineis needed for a refresh token, often withprompt=consent. - GitHub — scopes are space separated (
read:user user:email) and it is OAuth 2.0, not OIDC. - Apple — requires
response_mode=form_post; name and email scopes arrive only on first consent. - Kakao — scope names are the consent items configured in the app, such as
profile_nickname.
Checking it in OAuthLab
Panel ③ assembles the URL as you type and loads provider-shaped presets. Panel ④ parses a finished URL back into a table so you can see whether encoding came out as intended.
PKCE and URL checks run right here in your browser. Nothing you type is stored.
Open OAuthLabFrequently asked questions
Is it safe to expose client_id in a URL?
Yes. client_id is a public identifier, not a secret. It is protected by PKCE and exact redirect URI registration, not by secrecy.
Are scopes space separated or comma separated?
The OAuth 2.0 standard uses spaces. In a URL they become + or %20. Check each provider's documentation.
Can response_type carry several values like code token?
Hybrid flows allow it, but including token gives the request implicit characteristics. Use it only in special cases.
Sources
- RFC 6749 — The OAuth 2.0 Authorization Framework
- OpenID Connect Core 1.0
- Google — OpenID Connect (OAuth 2.0 for Login)
Read next
- PKCE S256: computing code_verifier and code_challenge correctlyThe RFC 7636 character set and length rules, the SHA-256 to Base64URL step, and where each value travels in the authorization and token requests.
- redirect_uri registration rules and open redirect riskWhy exact matching matters, and how wildcards, subdomains, path traversal and userinfo (@) confusion turn into account takeover.
- state and nonce: stopping CSRF and ID token replayWhere to store and compare state, where nonce is verified in an ID token, length and expiry, and the multi-tab and SPA failure modes.