Extension:LDAPAuthorization/ja

From mediawiki.org
This page is a translated version of the page Extension:LDAPAuthorization and the translation is 59% complete.
この拡張機能は MediaWiki 利害関係者グループ のメンバーが保守しています。
この拡張機能は LDAP Stack の一部であり、先に LDAPProvider 拡張機能をインストールする必要があります。
この拡張機能では、先に PluggableAuth 拡張機能をインストールする必要があります。

この拡張機能は、Extension:PluggableAuth または Extension:Auth remoteuser を使用してウィキにログインする際に、特定の認証要件をチェックします。 1 つでも条件を満たさない場合、ログインはキャンセルされます。

MediaWiki 拡張機能マニュアル
LDAPAuthorization
リリースの状態: 安定
作者 Cindy Cicalese, Mark A. Hershberger, Robert Vogel
最新バージョン 1.0.0
互換性の方針 MediaWiki とともにリリースされるスナップショット。 master には後方互換性がありません。
MediaWiki 1.31+
Composer mediawiki/ldap-authorization
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード
  • $wgAutoAuthUsernameNormalizer
  • $wgAutoAuthRemoteUserStringParser
  • $wgAutoAuthRemoteUserStringParserRegistry
  • $wgAutoAuthBypassWithCookieUsernameRemoteAddrs
Quarterly downloads 368 (Ranked 11th)
translatewiki.net で翻訳を利用できる場合は、LDAPAuthorization 拡張機能の翻訳にご協力ください

インストール

  • Install the LDAPProvider and PluggableAuth extensions.
  • ダウンロードして、ファイルをextensions/フォルダー内のLDAPAuthorizationという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/LDAPAuthorization
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'LDAPAuthorization' );
    
    必要に応じて設定します。
  • Yes 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

拡張機能の設定

LocalSettings.php で使用する場合、これらの変数の前に $LDAPAuthorization を付ける必要があります
名前 既定 説明
AutoAuthRemoteUserStringParserRegistry
{
 "domain-backslash-username": "MediaWiki\\Extension\\LDAPAuthorization\\AutoAuth\\RemoteUserStringParser\\DomainBackslashUsername::factory",
 "username-at-domain": "MediaWiki\\Extension\\LDAPAuthorization\\AutoAuth\\RemoteUserStringParser\\UsernameAtDomain::factory"
}
提供されたドメイン-利用者名からドメインと利用者名を抽出する、さまざまなパーサー用のファクトリー コールバックのレジストリです。

Must return IRemoteUserStringParser object.

Extension:Auth remoteuser が提供する自動認証の場合のみ使用されます。

AutoAuthRemoteUserStringParser "domain-backslash-username" 与えられたドメイン-利用者名からドメインと利用者名を抽出するために必要なパーサーを構成します。 許容される値:
  • "domain-backslash-username" (Use this if $_SERVER['REMOTE_USER'] = "SOMEDOMAIN\\Some username")
  • "username-at-domain" (Use this if $_SERVER['REMOTE_USER'] = "some.username@somedomain.local")

Only used in case of auto-authentication provided by Auth remoteuser.

AutoAuthUsernameNormalizer "" A callback that allows to modify the username when Extension:Auth_remoteuser is used for network based authentication. E.g. "strtolower".

If form based authentication is also enabled though Extension:LDAPAuthentication2 this should have the same value as $LDAPAuthentication2UsernameNormalizer.

Extension:Auth remoteuser が提供する自動認証の場合のみ使用されます

ドメイン構成設定

名前 既定 説明
rules.groups.required [] ログイン処理を完了するために必要なグループ DN の配列。 あるグループに所属しているだけで (論理的 OR) 認可される。
rules.groups.excluded [] Array of group DNs that the user may not be member of to complete the login process. あるグループに所属していれば (論理的 OR)、ログインを禁止されることはない。
rules.attributes {} This implements the "attributes mapping" rule from Extension:LDAP Authentication

Example:

{
    "&" : {
    	"status": "active",
    	"|": {
    		"department": [ "100", "200" ],
    		"level": [ "5", "6" ]
    	}
    }
}
rules.query "" Allows to provide a standard LDAP query to be tested against the user. Comparable to $wgLDAPAuthAttribute from Extension:LDAP Authentication

Example:

&(active=TRUE)(permissionAlias=cn=X,ou=Y,ou=accounts,dc=company,dc=local)

Example 1

LocalSettings.php で設定したい場合は、この例のように LDAPProvider で設定を拡張できます:

$LDAPProviderDomainConfigProvider = function() {
	$config = [
		'LDAP' => [
			'connection' => [
				...
			],
			'authorization' => [
				'rules' => [
					'groups' => [
						'required' => [ "groupname" ]
					]
				]
			]
		]
	];
...

Example 2

Here is a complete example LocalSettings.php configuration for Active Directory:

$LDAPProviderDomainConfigProvider = function()
{
	$config =
	[
		"example.com" =>
		[
			"connection" =>
			[
				"server" => "ldap.example.com",
				"user" => "cn=ldap,cn=Users,dc=example,dc=com",
				"pass" => "password",
				"basedn" => "dc=example,dc=com",
				"groupbasedn" => "dc=example,dc=com",
				"userbasedn" => "dc=example,dc=com",
				"searchattribute" => "samaccountname",
				"searchstring" => "USER-NAME@example.com",
				"usernameattribute" => "samaccountname",
				"realnameattribute" => "cn",
				"emailattribute" => "mail",
				"grouprequest" => "MediaWiki\\Extension\\LDAPProvider\\UserGroupsRequest\\GroupMember::factory"
			],
			"authorization" =>
			[
				"rules" =>
				[
					"groups" =>
					[
						"required" => [ "cn=Developers,cn=Users,dc=example,dc=com" ]
					]
				]
			],
			"groupsync" =>
			[
				"mechanism" => "mappedgroups",
				"mapping" =>
				[
					"sysop" => "cn=Developers,cn=Users,dc=example,dc=com",
					"bureaucrat" => "cn=Developers,cn=Users,dc=example,dc=com"
				]
			],
			"userinfo" =>
			[
				"email" => "mail",
				"realname" => "cn",
				"properties.gender" => "gender"
			]
		]
	];

	return new \MediaWiki\Extension\LDAPProvider\DomainConfigProvider\InlinePHPArray( $config );
};

バージョン化

LDAP Stack Extensions are targeted/qualified for MediaWiki LTS releases only.
However, this table helps to determine which extension-releases to use across all recent versions.

MediaWiki リリース Recommended Extension Version テストの状態 最終テスト日
1.35 (LTS) LDAPxxx_master テスト済 2020年3月