Skip to main content

Adding a template

The templates of the dropdown Vorlage come from resources/provider-templates.json of the plugin. The dropdown lists them sorted by name.

{
"$schema": "./provider-templates.schema.json",
"templates": [
{
"key": "twitch",
"name": "Twitch",
"slug": "twitch",
"issuer": "https://id.twitch.tv/oauth2",
"scopes": "openid user:read:email",
"extra_authorize_params": "{\"claims\":\"{\\\"id_token\\\":{\\\"email\\\":null,\\\"email_verified\\\":null}}\"}",
"button_color": "#9146FF",
"icon": "fa-brands fa-twitch",
"console_url": "https://dev.twitch.tv/console/apps"
}
]
}

Fields​

FieldRequiredMeaning
keyyesUnique ID of the template. Letters, digits, - and _.
nameyesName in the dropdown and of the provider.
slugnoSlug of the provider.
issuernoIssuer URL. Use placeholders like <YOUR_DOMAIN> for self-hosted providers.
scopesnoFalls back to openid email profile.
extra_authorize_paramsnoA JSON string as above, or a JSON object.
button_colorno#RRGGBB. A missing or invalid value falls back to the neutral gray #6B7280.
iconnoFont Awesome class name.
console_urlnoLink to the developer console of the provider, shown after the template is applied. Must start with https://.

A missing field is emptied when the template is applied. Client ID and client secret are never part of a template.

The JSON Schema resources/provider-templates.schema.json describes all fields. The file links it with $schema, so editors like VS Code or PhpStorm check the file while you edit it.

Errors​

An invalid entry is skipped. If the file is missing, or is not a JSON object with an array templates, the dropdown is hidden. Both are written to the log of Laravel, and the create page keeps working.

Contributing​

Changes to the file are overwritten by an update of the plugin, so please send new templates as a pull request. Make sure that the configuration you suggest is tested!