opyebOAuthLab

Authorization URL parameters: what to send and why

Request shape · 8 min read

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

ParameterRoleNotes
response_typeKind of response wantedcode for the authorization code flow. token is implicit, removed in OAuth 2.1.
client_idClient identifierA public value, not a secret.
redirect_uriWhere the response goesMust equal the registered value character for character.
scopeRequested permissionsSpace separated; encoded as %20 or +.
stateCSRF protectionFresh 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. none cannot be combined.
  • login_hint — email or phone hint. Always encode user-supplied values.
  • response_mode — query, fragment or form_post. Apple commonly requires form_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=offline is needed for a refresh token, often with prompt=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 OAuthLab

Frequently 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

Read next