OAuth applications
Let a clan site, a bot or an app sign players in with their account on your site: registration, return addresses, the secret and replacing it.
An OAuth application is another site, bot or program where players sign in with their account from your site. For example, a clan site shows a sign-in button, the player lands on your site, clicks "Allow" and goes back to the clan site already recognised. By the end of this page you'll have a registered application and the details to hand to its developer.
Only the site owner can open this screen (the admin.boss permission). If a script needs site data without players signing in, OAuth is the wrong tool: give it an API key.
Register an application
Name the app and pick its kind
Players see the "Application name" on the sign-in screen, for example "Clan site". Under "Kind of application", choose "Site or bot on a server" when the app runs on its own server and can keep a password. Choose "Browser or mobile app" for apps whose code sits on the player's device: they get no secret.

Add return addresses
In "Return addresses", type the address the player lands on after signing in and press Enter. The app's developer gives you these, for example https://clan.example.com/auth/callback. The site refuses sign-in that returns to any other address.
Choose what the app may access
"Know who signed in" and "See the name and avatar" are ticked by default. Add "See the e-mail address" only if the app needs it. The same list holds REST API resources, for apps that will read or change data on the player's behalf. Players see this list on the consent screen.
Click "Register application". A server app gets "Application registered. Copy the secret now, it is shown only once." Hand the developer the "Application ID" (it starts with client_) and the secret (it starts with secret_).
Add at least one return address, starting with https://.
An http:// address is accepted only for localhost, 127.0.0.1 and ::1, when the developer tests sign-in on their own machine. A mobile app may use an address with its own scheme, such as com.example.app:/callback.
What to give the developer
The app's developer needs the ID, the secret and the address of the OAuth server settings:
https://<YOUR_DOMAIN>/.well-known/openid-configurationIt lists the sign-in (/oauth/authorize), token (/oauth/token) and player data (/oauth/userinfo) addresses. The site speaks OAuth 2 and OpenID Connect: authorization code, PKCE with S256 only, refresh tokens and client credentials. Browser and mobile apps must send PKCE.
Replace the secret or delete the app
"Replace secret" issues a new secret and the old one stops working at once. Tokens the app obtained for itself (working without a player) are revoked, while players who already signed in stay signed in. Browser and mobile apps have no secret, and the button answers "Browser and mobile apps have no secret to replace."
"Delete" revokes every token of the app, players' tokens included. Players can no longer sign in through it.
Registering, editing and replacing the secret ask you to confirm with your password or a 2FA code. If your account has neither, set a password in your profile.
Reference
The field is folded under "More options". Change it only if the app's developer asks.
| Option | What it allows | Default |
|---|---|---|
| Sign players in | the regular sign-in through the consent screen (authorization_code) | on |
| Keep them signed in | the app renews sign-in without the player (refresh_token) | on |
| Work on its own, without a player | the app gets a token for itself (client_credentials), server apps only | off |
A sign-in code lives 5 minutes, an access token an hour, a refresh token 30 days. The values live in the api.oauth settings: code_ttl (300), access_ttl (3600), refresh_ttl (2592000), in seconds. api.oauth.enabled turns the OAuth server off entirely.
The php flute oauth:client command does the same and prints the ID and the secret right in the console:
php flute oauth:client --name "Clan site" --redirect https://clan.example.com/auth/callback [OK] OAuth client registered.
--------------- ---------------------------------------------------------
client_id client_6667b16d423ec391
client_secret secret_756c02590fbddeda0e7e0a49d4342817fac192be16a1e667
name Clan site
redirect_uris https://clan.example.com/auth/callback
scopes openid profile email
grants authorization_code, refresh_token
--------------- ---------------------------------------------------------
[WARNING] Store the client_secret now — it is not recoverable.The secret is shown once, so save it right away.
--public registers a browser or mobile app without a secret, --scope and --grants set access and sign-in methods. All options are in the CLI reference.
Public clients must supply a PKCE code_challenge. means a browser or mobile app didn't send PKCE. Only code_challenge_method=S256 is supported. means the plain method is refused. This client may not use the client_credentials grant. means "Work on its own, without a player" isn't turned on for the app.
