Beta

Create a tenant

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

Client IDs and registration

Every exchange so far started with the photo service already knowing the printer. That knowledge comes from a registration: a record at the authorization server that names one client and sets the rules every later request is checked against.

Introducing the printer

When the printer sent Ava Archer's browser to the photo service so she could connect her photos, the authorization server recognized photo-printer in the request. It knew where to send her browser back, and it knew how the printer would prove itself at the token endpoint. None of that happened by accident. Before the printer sent its first request, someone at the printing company introduced it to the photo service.

That introduction is client registration. The photo service runs a developer console, a set of pages where software developers manage their applications. A developer at the printing company signs in, chooses Register an application, and fills in a form: the application's name, its website, the address a person's browser should return to, and the kind of access it needs.

When the form is saved, the authorization server creates a record for the printer and assigns it a client ID:

Client ID: photo-printer
Client type: confidential
Redirect URI: https://printer.example/oauth/callback
Grant types: authorization_code, refresh_token
Scopes it may request: photos.read
Client authentication: client_secret_basic

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

The client ID is how the printer names itself in every request. It appears in authorization URLs, so it passes through browsers, history and server logs. That is fine, because a client ID is an identifier, not a credential. Knowing photo-printer lets someone write a request that claims to come from the printer. It does not let them prove that claim. As Public and confidential clients explained, a confidential client proves its identity with a separate credential, and a public client has no such proof to offer.

The value is unique only at the authorization server that issued it. photo-printer means something to the photo service. Another service the printer also uses would issue its own client ID, perhaps a random string such as 8f3c21e9-6b4d-4a1f-9e2c-5d07b8a4c613, and keep its own registration. Sent to that other service, photo-printer names nothing at all.

What a registration records

The summary above is more than paperwork. Each line becomes a rule the authorization server applies to every request that names photo-printer.

The client type tells the server whether to expect client authentication. The redirect URI limits where authorization responses may go. The grant types list the ways this client may obtain tokens, so a request from photo-printer using the client credentials grant is refused, even if everything else about it is correct. The scopes limit what the client can receive at all, before any person is asked to approve it. The client authentication line says how the client will prove itself, and the server holds whatever it needs to check that proof. Here, client_secret_basic means the printer sends a secret in the Authorization header of its token requests; the next lessons in this group compare it with the other methods.

photo-printer

Client type
confidential
Redirect URI
https://printer.example/oauth/callback
Grant types
authorization_code, refresh_token
Scopes it may request
photos.read
Client authentication
client_secret_basic

Checked against the registration

  • authorization_code, photos.read, registered address
  • client_credentials: unauthorized_client
  • https://printer.example/other: refused
  • photos.write: invalid_scope or dropped

Only the first goes on to consent, policy and the API

A request that falls outside the registration never reaches those decisions.

Each line of the printer's registration is a rule: requests inside it go on to the usual checks, and requests outside it stop at the authorization server.

Registration therefore decides what a client is allowed to attempt. Each request still has its own checks: Ava can refuse consent, the photo service can apply policy, and the API can reject an operation. A request that falls outside the registration never reaches those decisions. An unregistered redirect URI or grant type is rejected, because this client was never set up to use it. As Errors and denied access showed, a grant the client may not use comes back as unauthorized_client. A scope outside the registration is either rejected with invalid_scope or dropped from what the server grants, depending on the server, so the client never receives it.

The record also gives the photo service a place to act. It can suspend a client that misbehaves, which stops new authorization requests and token requests from that client. It can list the people who have connected a client, show the client's name in Ava's list of connected applications, and remove its access in one place.

One application, several clients

The printing company does not run just one piece of software. Its website's backend connects to the photo service, and so does its phone app, which lets Ava pick photos for a book on her phone and is registered as photo-printer-app. The company also runs a test copy of the website, where developers try changes before releasing them. Its scheduled job that sends orders to the print lab is a client too, but of a different authorization server: the print lab registered it separately, with its own client ID.

It is tempting to register "the printer" once and share that registration everywhere. That would blur exactly the things registration is meant to keep precise.

The website's backend is a confidential client that can keep a secret. The phone app is a public client that cannot, because every copy installed on a phone carries the same files, and anyone can take a copy apart. Given one shared registration, the photo service could not tell which one was asking, and it could not require client authentication from one without breaking the other. The test website has its own return address on a test domain, which should never be accepted for the real service. And if the phone app's client ID were ever abused, the printing company would want to suspend that client alone, not its website as well.

So each deployment with different credentials, return addresses or permissions gets its own registration and its own client ID. Ava's account might list them under one name, Photo Printer, while the authorization server treats them as separate clients with separate rules. A credential belongs to one registration too: the website's secret proves nothing for photo-printer-app, even though the same company holds both.

A developer filling in a form is the most familiar way to register a client, but it is not the only one. An administrator can create registrations for an organization's own applications, and some services let software register itself through an API, which Registering a client dynamically, in Advanced OAuth, covers. A newer approach, Client ID Metadata Documents, skips the registration step altogether: the client ID is itself an HTTPS URL, and the authorization server fetches the client's details from that address the first time it sees the client. It suits software that meets many authorization servers it has never been introduced to.

Check your understanding

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

Someone copies the printer's client ID from an authorization URL. What can they do with it? 1 of 3

Choose one answer.

The printing company has a website backend and a phone app, photo-printer-app. Why give them separate registrations? 2 of 3

Choose one answer.

photo-printer is registered for authorization_code and refresh_token. It sends a client credentials request with its correct secret. What happens? 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