Skip to Content
Integrations

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

Open the list

AdminOAuth applications and click "Register application".

The OAuth applications list with the Application ID, Kind and What the app may access columns

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.

The Register application window with the name, kind and return address fields

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-configuration

It 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

Next

On this page