Skip to content

v0.32.0

Release Date: 2026-11-05

A manager can now replace a managed principal's printed card in one step, and the sign-in methods page becomes a page an application can send people to from its own settings.

  • Replace login tokens. managedprincipal.Service.ReplaceLoginTokens revokes every live login token of a managed principal and issues one new token, in one transaction. It takes the same input as IssueLoginToken (name, single use, expiry) and is authorized the same way, by manage_credentials. If issuing fails, nothing is revoked, so a failure leaves the old card working rather than none. Two replaces at once on PostgreSQL leave one token. Sessions already signed in with an old token keep running; RevokeAll ends them too.
  • Over HTTP. managedprincipal.NewHandler serves it as POST /{principalID}/login-tokens/replace, with the issue body. It answers 201 with the new token and revoked, the number of tokens it revoked. mpclient.Client.ReplaceLoginTokens calls it.
  • Audited once. A replace emits managed_principal.login_tokens_replaced with the new token's identifiers and the number revoked.
  • Checked under the lock. Issuing and replacing now check the issuer's authority under the managed principal's row lock, in the transaction that issues, as removing a manager does. A manager removed at the same moment can no longer be issued a token, which IssueLoginToken previously allowed.

Tokens are stored only as hashes, so a lost or shared card cannot be printed again from what is stored; replacing it is how a card is reprinted.

Sign-in methods

  • What is linked. /account/sign-in-methods shows the account's email and the providers already linked to it, and offers a Link button only for the others. Directories list linked providers through the optional LinkedProviderLister interface, which the Ent and memory directories implement; with another directory the page offers every provider, as before.
  • Back to the application. An application links to the page with return_to, such as https://auth.example.com/account/sign-in-methods?return_to=https://app.example.com/settings. It passes the same allowlist as sign-in's return_to (a path on the issuer, or an origin in allowed_redirect_origins) and shows a Back to link, named by signed_out_name or else its host. It is kept through signing in first, the link button, the provider and the return to the page, and validated again at each step. An invalid return_to is ignored.

The release adds no breaking change.

Upgrading

Nothing is required. Applications that print login cards can offer "Replace card" with the new call instead of revoking each token and issuing a new one. Applications can link their account settings to /account/sign-in-methods?return_to=<their settings page>.

See Replacing a Card and Linking sign-in methods.