這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

OpenID Connect Server

描述

With this plugin you can use your own WordPress install to authenticate with a webservice that provides OpenID Connect to implement Single-Sign On (SSO) for your users.

The plugin is currently only configured using constants and hooks as follows:

Define the RSA keys

If you don’t have keys that you want to use yet, generate them using these commands:

openssl genrsa -out oidc.key 4096
openssl rsa -in oidc.key -pubout -out public.key

And make them available to the plugin as follows (this needs to be added before WordPress loads):

define( 'OIDC_PUBLIC_KEY', <<<OIDC_PUBLIC_KEY
-----BEGIN PUBLIC KEY-----
...
-----END PUBLIC KEY-----
OIDC_PUBLIC_KEY
);

define( 'OIDC_PRIVATE_KEY', <<<OIDC_PRIVATE_KEY
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
OIDC_PRIVATE_KEY
);

Alternatively, you can also put them outside the webroot and load them from the files like this:

define( 'OIDC_PUBLIC_KEY', file_get_contents( '/web-inaccessible/oidc.key' ) );
define( 'OIDC_PRIVATE_KEY', file_get_contents( '/web-inaccessible/private.key' ) );

Define the clients

Define your clients by adding a filter to oidc_registered_clients in a separate plugin file or functions.php of your theme or in a MU-plugin like:

add_filter( 'oidc_registered_clients', 'my_oidc_clients' );
function my_oidc_clients() {
    return array(
        'client_id_random_string' => array(
            'name' => 'The name of the Client',
            'secret' => 'a secret string',
            'redirect_uri' => 'https://example.com/redirect.uri',
            'grant_types' => array( 'authorization_code' ),
            'scope' => 'openid profile',
        ),
    );
}

Exclude URL from caching

  • example.com/wp-json/openid-connect/userinfo: We implement caching exclusion measures for this endpoint by setting Cache-Control: 'no-cache' headers and defining the DONOTCACHEPAGE constant. If you have a unique caching configuration, please ensure that you manually exclude this URL from caching.

Github Repo

You can report any issues you encounter directly on Github repo: Automattic/wp-openid-connect-server

評價

There are no reviews for this plugin.

貢獻者及開發者

“OpenID Connect Server” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

OpenID Connect Server 外掛目前已有 3 個本地化語言版本。 感謝所有譯者為這個外掛做出的貢獻。

將 OpenID Connect Server 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

修改日誌

1.3.3

  • Fix failing login when Authorize form is non-English [#108]
  • Improvements in site health tests for key detection [#104][#105]

1.3.2

  • Prevent userinfo endpoint from being cached [#99]

1.3.0

  • Return display_name as the name property [#87]
  • Change text domain to openid-connect-server, instead of wp-openid-connect-server [#88]

1.2.1

  • No user facing changes

1.2.0

  • Add oidc_user_claims filter [#82]