|
|
|
@ -73,6 +73,9 @@ class IsekaiOIDCAuth extends AbstractPrimaryAuthenticationProvider {
|
|
|
|
|
$config = $wgIsekaiOIDC;
|
|
|
|
|
|
|
|
|
|
$oidc = self::getOpenIDConnectClient();
|
|
|
|
|
|
|
|
|
|
$requestCtx = RequestContext::getMain();
|
|
|
|
|
|
|
|
|
|
if ($oidc->authenticate()) {
|
|
|
|
|
$accessToken = $oidc->getAccessToken();
|
|
|
|
|
$refreshToken = $oidc->getRefreshToken();
|
|
|
|
@ -88,7 +91,7 @@ class IsekaiOIDCAuth extends AbstractPrimaryAuthenticationProvider {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$authManager = MediaWikiServices::getInstance()->getAuthManager();
|
|
|
|
|
$request = RequestContext::getMain()->getRequest();
|
|
|
|
|
$request = $requestCtx->getRequest();
|
|
|
|
|
$session = $request->getSession();
|
|
|
|
|
$session->clear('AuthManager::AutoCreateBlacklist'); // 防止缓存检测
|
|
|
|
|
|
|
|
|
@ -251,7 +254,7 @@ class IsekaiOIDCAuth extends AbstractPrimaryAuthenticationProvider {
|
|
|
|
|
$oidc->setRedirectURL( $redirectURL );
|
|
|
|
|
wfDebugLog( self::LOG_TAG, 'Redirect URL: ' . $redirectURL );
|
|
|
|
|
|
|
|
|
|
if ( isset( $_REQUEST['forcelogin'] ) ) {
|
|
|
|
|
if ( isset( $_REQUEST['force'] ) || isset( $_REQUEST['forcelogin'] ) ) {
|
|
|
|
|
$oidc->addAuthParam( [ 'prompt' => 'login' ] );
|
|
|
|
|
}
|
|
|
|
|
if ( isset( $config['authparam'] ) &&
|
|
|
|
|