Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

Redirect URIs and client metadata

A registration holds two kinds of information. Some of it decides where the authorization server will send codes; some of it describes the client to the people asked to approve it. Both come from the client's developer, but only the first is enforced.

Registering return addresses

The Redirects and authorization codes lesson explained why the authorization server compares a requested redirect URI with the registered value exactly. Registration is where those values come from.

A client can register more than one. The printer's website might accept returns at two paths, one for connecting a photo account and one for adding a second account later:

https://printer.example/oauth/callback
https://printer.example/oauth/add-account/callback

All domains, identifiers, and credentials in these examples are fictional.

Each authorization request names the one it wants, and the server accepts only an exact match with an entry in the list. Registering a pattern such as https://*.printer.example/ instead would let any address on any subdomain receive codes, including a forgotten marketing page or a subdomain someone else later controls. A list of specific addresses keeps the set of possible destinations small and known.

Web clients register HTTPS addresses on domains they control. The printer's test website, at https://test.printer.example/oauth/callback, belongs in the test client's registration, not in the production list. If it were added to the production client, a mistake on the test site could leak codes for real accounts.

Return addresses for installed apps

The printer's phone app, photo-printer-app, and its desktop app have no website of their own to return to. Each still needs the browser to hand the authorization response back to the app, and installed applications have three common ways to receive it. The first two suit phone apps; the third is for desktop applications.

A claimed HTTPS address is a web address that the operating system has verified belongs to the app, such as https://app.printer.example/oauth/callback. When the browser opens it, the system passes it to the app. Because the printing company had to prove control of the domain, another app cannot claim the same address. This is the strongest of the three where the platform supports it.

A private-use URI scheme is a custom scheme the app registers with the operating system, written as a reversed domain name the developer controls, such as example.printer:/oauth/callback. It is widely supported, but nothing stops another app on the same device from registering the same scheme. That is one reason installed apps must use PKCE: a code delivered to the wrong app is useless without the verifier, which never left the app that started the request.

A loopback address suits desktop applications and command-line tools, such as the printer's desktop app. The application listens briefly on the local machine and registers an address such as http://127.0.0.1/oauth/callback. The operating system chooses a free port each time, so the authorization server lets the port vary for loopback addresses while still matching the rest exactly: the app can ask for http://127.0.0.1:51004/oauth/callback today and a different port tomorrow. Plain HTTP is acceptable here because the response never leaves the machine. A phone app uses one of the first two instead. They are how mobile platforms hand a response to an app, and an app listening on a local port may be suspended while the browser is in front.

The address names the literal loopback IP, 127.0.0.1 for IPv4 or [::1] for IPv6, rather than localhost. Current guidance marks localhost as not recommended. It is a name the machine must resolve, and a changed hosts file or resolver setting can point it somewhere other than the local machine. An app that opens its listener by name can end up listening on a network interface other than loopback, and client-side firewalls are more likely to get in the way. Where the app cannot be sure whether IPv4 or IPv6 will be available, it can register and try both.

Phone app

https://app.printer.example/oauth/callback
Another app on the device
Cannot claim the same address

The strongest of the three

Phone app

example.printer:/oauth/callback
Another app on the device
Can register the same scheme

Useless without the verifier

Desktop app

http://127.0.0.1:51004/oauth/callback
The port
May vary
localhost in its place
Refused

The response never leaves the machine

Three ways an installed app receives its authorization response, and what another app on the same device can do with each.

Describing the client

Registrations also hold client metadata: descriptive values the authorization server can show to people. Expressed with the standard field names that registration APIs use, the printer's might be:

{
  "client_name": "Photo Printer",
  "client_uri": "https://printer.example",
  "logo_uri": "https://printer.example/logo.png",
  "policy_uri": "https://printer.example/privacy",
  "tos_uri": "https://printer.example/terms",
  "contacts": ["[email protected]"]
}

The consent screen uses these values. When Ava was asked whether to let the printer read her photos, the name, logo and links on that screen came from this record. They help her recognize the application and find its privacy policy before she decides.

They are also exactly what an impostor would like to control. Anyone who can register a client can type "Photo Printer" into the name field and upload a familiar logo. The authorization server cannot simply trust what a developer wrote about their own application.

Careful services treat descriptive metadata as a claim. They may verify that the client controls the domain in client_uri, check that links point to the same site, review applications before they can reach many users, or show unverified clients with a clear warning. Where a consent screen shows the domain the browser will return to, that domain is often a better clue than the name. The name is free text. The return address is enforced.

Settings that limit requests

Alongside the description, a registration holds technical settings that narrow what the client may do. The most common, again with their standard names:

{
  "grant_types": ["authorization_code", "refresh_token"],
  "response_types": ["code"],
  "token_endpoint_auth_method": "client_secret_basic",
  "scope": "photos.read"
}

Each one closes off requests the client has no reason to make. A client registered only for the authorization code flow cannot use client credentials. A client limited to photos.read cannot receive photos.delete, however its request is written: the server either rejects the request with invalid_scope or leaves that scope out of what it grants. A client registered for one authentication method cannot switch to another at the token endpoint. Client authentication methods looks at those methods.

These limits work best when they are as narrow as the client actually needs. A registration that allows every grant and every scope gives an attacker who obtains the client's credentials, or who controls one of its return addresses, every capability at once. A registration that matches the client's real behavior turns many mistakes and attacks into ordinary rejections.

Check your understanding

Try these questions before moving on. If an answer isn't right, use the feedback and try again.

A developer wants to register a wildcard redirect URI that matches every subdomain of printer.example. What is the problem? 1 of 3

Choose one answer.

A consent screen shows the name "Photo Printer" and a familiar logo. What does that prove? 2 of 3

Choose one answer.

The printer's desktop app registered http://127.0.0.1/oauth/callback. Which return address can its request use? 3 of 3

Choose one answer.

Try it in the Lab

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow all", you consent to optional analytics. Cookie Policy

Learn identity