fly3949 / flarum-ext-sso
A SSO extension for flarum.
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 13
Type:flarum-extension
Requires
- flarum/core: >=0.1.0-beta.12 <0.1.0-beta.14
- dev-master
- 0.0.1
- dev-dependabot/npm_and_yarn/js/json5-1.0.2
- dev-dependabot/npm_and_yarn/js/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/js/loader-utils-and-webpack-cli-1.4.2
- dev-dependabot/npm_and_yarn/js/terser-4.8.1
- dev-dependabot/npm_and_yarn/js/minimist-1.2.6
- dev-dependabot/npm_and_yarn/js/ajv-6.12.6
- dev-dependabot/npm_and_yarn/js/path-parse-1.0.7
- dev-dependabot/npm_and_yarn/js/browserslist-4.16.6
- dev-dependabot/npm_and_yarn/js/lodash-4.17.21
- dev-dependabot/npm_and_yarn/js/ssri-6.0.2
- dev-dependabot/npm_and_yarn/js/y18n-4.0.1
- dev-dependabot/npm_and_yarn/js/elliptic-6.5.4
- dev-dependabot/npm_and_yarn/js/ini-1.3.8
This package is auto-updated.
Last update: 2025-01-06 12:14:22 UTC
README
A Flarum extension. A SSO extension for flarum.
!!! Attention !!!
It is NOT fully tested. Do NOT install it in production.
Installation
Use Bazaar or install manually with composer:
composer require fly3949/flarum-ext-sso
How To Use
After installation, you should generate a secret key (strong enough) and fill it into the extension setting page.
Then, in your app, redirect your user to the login url:
https://example.com/session/sso_login?
email=example@example.com &
id=1 &
username=example &
time=1591359188 &
signature=3ec02dd23291fbed8faac4cef71b5f284c0ff955cc1d27f5e30efabe4ee40008
Here is the example code (in a Laravel app):
$email = 'example@example.com'; $id = 1; $username = 'example'; $now = Carbon::now()->timestamp; $secret = env('FLARUM_SSO_KEY'); // for example: VRSW1xDk1e1gsC8zIOaOiJhg6xTKrqm4o6Gt7LAS $data = [ 'email' => $email, 'id' => $id, 'username' => $username, 'time' => $now, 'signature' => hash_hmac('sha256', $email . $id . $username . $now, $secret) ]; $query = http_build_query($data); return redirect('https://example.com/session/sso_login?' . $query);
Updating
composer update fly3949/flarum-ext-sso