Extensions and permissions
An extension is an extra request that travels with an operation, such as sign-in. You add it to the operation's first call, and you read its answer from the result after verification.
API reference:JavaScript·Ruby
Callback method: how the response comes back
By default, the authenticator delivers the response with a GET to your callback URL, in the query string. You can ask for a form POST, or for the response in the URL fragment, which browsers do not send to servers. Receiving the response explains which one to choose.
| Method | Delivery |
|---|---|
GET | A GET with response in the query string. The default. |
POST | A form POST to your callback URL with a response field. |
HASH | A GET with response in the URL fragment, which browsers do not send to servers. |
Ask for it with ext: {callbackMethod: 'POST'} or ext: {callbackMethod: 'HASH'}. The authenticator refuses a request with a method that is not in this table.
Manifest: your name and icon on the user's home screen
The authenticator lists the websites a user signed in to on its home screen. With the manifest, you can set your website's name, the page to open, and an icon. Set it with ext: {manifest: {name, startUrl, iconUrl}}. Nothing comes back in the result.
| Field | Meaning |
|---|---|
name | The name shown to the user, at most 255 bytes. |
startUrl | The page that opens from the home screen. It must be on the same origin as your callback URL. Otherwise, the base URL of the callback opens instead. |
iconUrl | A PNG or JPEG file of up to 128 KB, served with permissive CORS headers. |
Permissions: requests that run without asking
Ping and stamp run in the background, without a screen for the user, so the user allows them once, at sign-in. Ask with ext: {permissions: {ping: true, stamp: true}}, and ask only for what you plan to use. The approval screen tells the user what each permission allows, and approving the sign-in grants them. The result shows the decision for each one in ext.permissions, as true or false.
| Permission | Allows |
|---|---|
ping | Ping, a silent check that the user still holds the keys |
stamp | Stamp, a silent proof of the session for another website |
Sign and attest need no permission. The user reviews each of those requests on a screen and approves it there.
A permission belongs to the sign-in that granted it. Every later request also needs the session key of that sign-in, and a new sign-in replaces both.
Before you rely on an extension
- An authenticator may not support an extension. Read the result and handle a missing answer.
- Read back
ext.permissionsfrom the response to learn what was allowed. - Permissions typically last until the next sign-in, when the user decides again.