A Flarum extension. Generic oauth provider for Flarum
Adds a Generic
provider to FoF OAuth to enable Login with <your custom provider>
functionality.
Install with composer:
composer require blt950/oauth-generic
Example configuration, please consult your provider for the correct values.
- Client ID
<id from your provider>
- Client Secret
<secret from your provider>
- Scope
<scope from your provider>
or empty - Authorization Endpoint
https://yourprovider.com/oauth/authorize
- Token Endpoint
https://yourprovider.com/oauth/token
- User Information Endpoint
https://yourprovider.com/api/user
To correctly find your user fields that might be nested in arrays, the parameters support nesting such as:
- User ID
data-id
- Username
data-username
- Email
data-personal-email
Forcing or suggesting fields gives you the possiblity to force or pre-fill a suggested value when signing up the user.
- Force User ID
1
or0
. - Force Display Name
1
or0
. - Force Email
1
or0
.
If you wish to change the name of provider you can do so by editing the locale file. I did not find a way to make this dynamic.
composer update blt950/oauth-generic
php flarum cache:clear
Please file a pull request if you find issues or want to expand the functionality. Thank you for contributing.
- The nickname input field in signup modal fills in username regardless of display name is provided. This is due to get fixed in this pull request for a future Flarum version
- The icon of provider in admin panel is invisible due to FoF OAuth plugin forces a font-weight that won't display the font, it shows correctly other places though.
- The force settings are a boolean but have a string input, simply because boolean values are not supported for provider settings.