Turn on OAuth
SetuseOAuth to true in public/app.yaml. The launcher then shows its OAuth sign-in component, which gets an access token from the provider using one of these methods:
How sign-in works
- The OAuth client builds the authorization URL from your configuration.
- The launcher shows the provider’s sign-in page using the method you chose.
- The player signs in, and the provider redirects to the callback URL you registered with it.
- The launcher gets the authorization
codeoraccess_tokenfrom the callback:- Popup or frame: the callback page,
oauth.html, sends the result to the launcher window and closes the popup. - Browser: the callback URL points to the launcher’s internal web server. When it’s requested with a
code, the launcher fires aSkinApp.NewAuthCodenotification and redirects the browser towebServer.oauth.successUrlorwebServer.oauth.errorUrl.
- Popup or frame: the callback page,
Choose a callback URL
Localhost callback
If your provider allows a localhost callback, set the ports the launcher’s web server can use:app.yaml
http://127.0.0.1:<port>/.
To get the address and port the launcher picked, use app.expandString("{contentUrl}") when you build the authorization URL.
Callback on your own domain
Some providers don’t allow localhost callbacks. With CEF, the launcher can internally redirect a request for a URL on your own domain tooauth.html. This is called resource rewriting. Register a URL on a domain you own, then set it up in loadOAuthConfig() in src/redux/OAuth.js:
Browser method
With the browser method, the provider redirects to theredirectUrl in your OAuth client. Point it to an endpoint on the launcher’s internal web server, and set the same endpoint as webServer.oauth.redirectUrl. For example, if redirectUrl is app.expandString("{contentUrl}auth2"), set webServer.oauth.redirectUrl to auth2:
app.yaml
Set up Google sign-in
The skin comes with a sample Google configuration. Replace it with your own.Create the Google client
- In the Google Cloud console, go to APIs & Services → Credentials.
- Click Create Credentials → OAuth client ID.
- Set Application type to Web application.
- Under Authorized redirect URIs, add the callback URLs you chose.
- Copy the client ID.
Configure the skin
EditGOOGLE_OAUTH_CONFIG in src/constants/OAuthConfig.js:
- Set
clientIdto your client ID. - Set
redirectUrlto the callback URL you registered.
app.yaml:
app.yaml
OAuthResponseType.CODE, you need the Google client secret. See the comments in the same file and Google’s OAuth 2.0 for desktop apps. OAuthResponseType.TOKEN doesn’t return refresh tokens, so players would sign in every time they open the launcher.
Providers implement OAuth2 differently. To change how the launcher talks to yours, edit src/oauth/OAuthClient.js.

