blt950/oauth-generic

Generic OAuth2 provider for Flarum

Installs: 215

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 1

Open Issues: 0

Type:flarum-extension

v1.0.0 2024-07-01 20:21 UTC

This package is auto-updated.

Last update: 2024-11-02 10:11:26 UTC


README

License Latest Stable Version Total Downloads

A Flarum extension. Generic oauth provider for Flarum

Features

Adds a Generic provider to FoF OAuth to enable Login with <your custom provider> functionality.

Installation

Install with composer:

composer require blt950/oauth-generic

Configuration

Admin Panel

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 or 0.
  • Force Display Name 1 or 0.
  • Force Email 1 or 0.

Provider Name

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.

Updating

composer update blt950/oauth-generic
php flarum cache:clear

Requests and Issues

Please file a pull request if you find issues or want to expand the functionality. Thank you for contributing.

Known quirks and bugs

  • 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.

Links