Documentation
¶
Overview ¶
Command accountsd runs the account service as a standalone HTTP server, with guest and email accounts in SQLite or Postgres.
accountsd init -config accounts.yaml -issuer https://accounts.example.com -audience my-game accountsd genkey -config accounts.yaml -key key.pem -keyset keys.yaml accountsd serve -config accounts.yaml -key key.pem -keyset keys.yaml -sqlite accounts.db -addr :8080 ACCOUNTS_POSTGRES_DSN=postgres://... accountsd serve -config accounts.yaml -key key.pem -keyset keys.yaml -postgres
init writes a configuration with the default settings. genkey writes a new signing key and adds its public half to the key set file a game server verifies tokens with, keeping the keys already there; it replaces the key set file atomically, so a reader never sees half of it. Rotating a key is genkey with a new -key file, a restart on it once game servers have the new key set, and removing the old key from the key set once its tokens have expired. serve runs the service until SIGINT or SIGTERM; with -keyset it also accepts the tokens of every key in the key set and serves them at GET /v1/keys, so tokens signed before a rotation keep working on the service too.
Identity providers (Game Center, Play Games, Steam, OAuth) need their verifiers and platform credentials, so a game that links identities builds its own command around accounts.New with Options.Identities; this one serves guests and email accounts.