Toolvito

Works on this device

Oauth URL Builder

Type the parts of an OAuth 2.0 or OpenID Connect sign-in request and get the authorization URL, with every value encoded. Or paste such a URL to see its parts. The tool checks the request against RFC 6749, RFC 7636 and current advice. Nothing is fetched or sent.

Build or read a URL

Puts the parts of an OAuth 2.0 or OpenID Connect sign-in request together into one address, with every value encoded.

Parts of the request

The authorization endpoint of the service. A query it already has is kept.

The ID the service gave your app. It is not a secret; the client secret never goes into this address.

Optional in OAuth when the app has only one, required by OpenID Connect. It must match one the service knows.

Scopes with one space between them.

A random value your app makes for each sign-in and checks when the user comes back.

Made from a secret code verifier, for example with the PKCE Generator. Leave blank for no PKCE.

Other parameters

More options

Servers read both as a space.

The URL is written in this page. Nothing is fetched or sent.

The URL will show here

Type the parts of the request.

How to use the OAuth URL builder

  1. Choose Build an authorization request URL. Type the authorization endpoint of the service, choose the response type and type your client ID.
  2. Add the redirect URI, the scope and a state. For PKCE, paste a code challenge made from a secret code verifier (the PKCE Generator makes both).
  3. Add other parameters in rows, such as nonce, prompt or login_hint. Leave a row empty to leave it out.
  4. Copy the URL and open it in a browser to start a sign-in. Read the warnings first.
  5. To check a URL you have, choose Read an authorization URL into parts and paste it. Choose Edit these parts to change it in the build mode.

The parts of the request

  • response_type: code for the authorization code flow (RFC 6749 section 4.1). OpenID Connect adds id_token and combinations such as code id_token.
  • client_id: the ID the service gave your app. It is not a secret.
  • redirect_uri: where the user comes back. It must match one the service knows and may not hold a fragment (#).
  • scope: the access asked for, with one space between scopes (section 3.3).
  • state: a random value your app makes for each sign-in and checks when the user comes back, against cross-site request forgery (section 10.12).
  • code_challenge and code_challenge_method: PKCE (RFC 7636). The challenge is made from a code verifier that the app keeps secret and sends later with the token request.

How the values are encoded

Each name and value is turned into UTF-8 bytes. Every byte that is not A to Z, a to z, 0 to 9 or one of - . _ ~ becomes % and two hexadecimal digits (RFC 3986). So https://client.example.com/cb becomes https%3A%2F%2Fclient.example.com%2Fcb, and a space becomes %20. Under More options, a space can be written as + instead, as in form encoding (RFC 6749 appendix B); servers read both as a space.

If the endpoint already has a query, such as ?tenant=abc, it is kept and the new parameters follow it (RFC 6749 section 3.1). Each parameter may appear only once, and a parameter without a value counts as left out.

What the checks look for

  • The endpoint uses https, as RFC 6749 section 3.1 requires.
  • The implicit flow (response type token) is named: the OAuth 2.0 Security Best Current Practice (RFC 9700) says not to use it.
  • The code flow has PKCE, and the PKCE method is S256 rather than plain.
  • There is a state or PKCE, so that the request has protection against cross-site request forgery.
  • For OpenID Connect: openid is in the scope when an ID token is asked for, a nonce is sent with an ID token, and a redirect URI is given.
  • No secret is in the address. client_secret, code_verifier and password are refused when building, and hidden when reading, because browsers, their history and server logs see this address.

Worked example

The starting values give https://auth.example.com/authorize?response_type=code&client_id=s6BhdRkqt3&redirect_uri=https%3A%2F%2Fclient.example.com%2Fcb&scope=openid%20profile%20email&state=af0ifjsldkj&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&code_challenge_method=S256&nonce=n-0S6_WzA2Mj: an authorization code request with PKCE (S256) and OpenID Connect, with 8 parameters and no warnings. The client ID and the redirect URI are the examples of RFC 6749, and the challenge is the example of RFC 7636 appendix B.

Limits you should know

  • The tool writes and reads the address only. It does not open it, fetch a discovery document or check the client ID, the redirect URI or the scopes with the service.
  • It knows the parameters of RFC 6749, RFC 7636 and the common ones of OpenID Connect. Other parameters are written as typed, without checks of their meaning.
  • Pushed authorization requests (PAR) and request objects (JAR) are not built here.

Related tools