texthtml/mediawiki-oauth2-auth

本软件包最新版本(v1.0.2)没有可用的许可证信息。

从外部OAuth2服务器验证Mediawiki

安装: 42

依赖项: 0

建议者: 0

安全性: 0

星星: 1

关注者: 2

分支: 0

公开问题: 1

类型:mediawiki-extension

v1.0.2 2016-11-02 09:50 UTC

This package is auto-updated.

Last update: 2024-09-24 19:34:19 UTC


README

从外部OAuth2服务器验证Mediawiki用户

安装

composer require texthtml/mediawiki-oauth2-auth

// load the extension
\TH\MediaWiki\OAuth2Auth\Extension::load();

// configure the OAuth2 provider
$wgMediaWikiOAuth2Auth['provider.config'] = [
    'clientId'                => 'demoapp',     // The client ID assigned to you by the provider
    'clientSecret'            => 'demopass', // The client password assigned to you by the provider
    'redirectUri'             => 'https://example.com/callback-url',
    'urlAuthorize'            => 'https://auth.dataporten.no/oauth/authorization',
    'urlAccessToken'          => 'https://auth.dataporten.no/oauth/token',
    'urlResourceOwnerDetails' => 'https://auth.dataporten.no/userinfo',
];

// optional: select another OAuth2 provider @see https://github.com/thephpleague/oauth2-client/blob/master/docs/providers/thirdparty.md
$wgMediaWikiOAuth2Auth['provider.class'] = \League\OAuth2\Client\Provider\GenericProvider::class;

// option: or build it manually (without setting $wgMediaWikiOAuth2Auth['provider.config'])
$wgMediaWikiOAuth2Auth['provider'] = new \League\OAuth2\Client\Provider\GenericProvider::class([
    'clientId'                => 'demoapp',     // The client ID assigned to you by the provider
    'clientSecret'            => 'demopass', // The client password assigned to you by the provider
    'redirectUri'             => 'https://example.com/callback-url',
    'urlAuthorize'            => 'https://auth.dataporten.no/oauth/authorization',
    'urlAccessToken'          => 'https://auth.dataporten.no/oauth/token',
    'urlResourceOwnerDetails' => 'https://auth.dataporten.no/userinfo',
]);