WordPress Social Identity Provider
Set Up WordPress
To set up WordPress as a social identity provider, navigate to the following WordPress Developers page: Developer Resources . You'll need a WordPress account. You can then navigate to the WordPress My Applications page, where you can create a new web application, with the following information:
Name
Description
Website URL, which becomes your Application URL
Redirect URL(s); for IDM, normally
http://openidm.example.com:8080/
Type, which allows you to select Web clients
When complete and saved, you should see a list of OAuth Information
for your new web application. That information should include your Client ID
and Client Secret
.
Configure a WordPress Social Identity Provider
To configure a WordPress social identity provider, log in to the Admin UI and navigate to Configure > Social ID Providers.
Enable the WordPress social identity provider.
In the
WordPress Provider
pop-up that appears, the values forRedirect URI
should match the values that you've entered for Allowed Return URLs in "Set Up WordPress".Include the values that WordPress created for
Client ID
andClient Secret
, as described in "Set Up WordPress".Under regular and
Advanced Options
, include the options shown in the following appendix: "WordPress Social Identity Provider Configuration Details".
When you enable a WordPress social identity provider in the Admin UI, IDM generates the identityProvider-wordpress.json
file in your project's conf/
subdirectory.
When you review that file, you should see information beyond what you see in the Admin UI. The first part of the file includes the name of the provider, endpoints, as well as the values for clientId
and clientSecret
.
{ "provider" : "wordpress", "authorizationEndpoint" : "https://public-api.wordpress.com/oauth2/authorize", "tokenEndpoint" : "https://public-api.wordpress.com/oauth2/token", "userInfoEndpoint" : "https://public-api.wordpress.com/rest/v1.1/me/", "enabled" : true, "clientId" : "<someUUID>", "clientSecret" : { "$crypto" : { "type" : "x-simple-encryption", "value" : { "cipher" : "AES/CBC/PKCS5Padding", "stableId" : "openidm-sym-default", "salt" : "<hashValue>", "data" : "<encryptedValue>", "keySize" : 16, "purpose" : "idm.config.encryption", "iv" : "<encryptedValue>", "mac" : "<hashValue>" } } }, "scope" : [ "auth" ], ...
You should also see UI settings related to the social identity provider icon (badge) and the sign-in button, described in "Social Identity Provider Button and Badge Properties".
You'll see links related to the authenticationIdKey
, redirectUri
, and configClass
; the location may vary.
The file includes schema
information, which includes properties for each social identity account, as collected by IDM, as well as the order in which it appears in the Admin UI. When you've registered a user with a Wordpress social identity, you can verify this by selecting Manage > Wordpress, and then selecting a user.
Another part of the file includes a propertyMap
, which maps user information entries between the source
(social identity provider) and the target
(IDM).
If you need more information about the properties in this file, refer to the following appendix: "WordPress Social Identity Provider Configuration Details".
Configure User Registration to Link to WordPress
Once you've configured the WordPress social identity provider, you can activate it through User Registration. To do so in the Admin UI, select Configure > User Registration, and activate that feature. Under the Social tab that appears, enable Social Registration. For more information on IDM user self-service features, see "Self-Service End User UI".
When you enable Social Registration, you're allowing users to register on IDM through all active social identity providers.
WordPress Social Identity Provider Configuration Details
You can set up the WordPress social identity provider through the Admin UI or in a conf/identityProvider-wordpress.json
file. IDM generates the identityProvider-wordpress.json
file when you configure and enable this social identity provider in the Admin UI. Alternatively, you can create the file manually.
The following table includes the information shown in the Admin UI WordPress Provider pop-up window, along with associated information in the identityProvider-wordpress.json
file:
Property (UI) | Property (JSON file) | Description |
---|---|---|
Client ID | clientId | The client identifier for your WordPress App |
Client Secret | clientSecret | Used with the Client ID to access the applicable WordPress API |
Scope | scope | An array of strings that allows access to user data; see WordPress's OAuth2 Authentication Documentation. |
Authorization Endpoint | authorizationEndpoint | Typically https://public-api.wordpress.com/oauth2/authorize ; known as a WordPress Authorize URL. |
Token Endpoint | tokenEndpoint | Endpoint that receives a one-time authorization code, and returns an access token; typically https://public-api.wordpress.com/oauth2/token ; known as a WordPress Request Token URL. |
User Info Endpoint | userInfoEndpoint | Endpoint that transmits scope-related fields; typically https://public-api.wordpress.com/rest/v1.1/me/ |
Not in the Admin UI | name | Name of the social identity provider |
Not in the Admin UI | type | Authentication module |
Not in the Admin UI | authenticationId | Authentication identifier, as returned from the User Info Endpoint for each social identity provider |
Not in the Admin UI | propertyMap | Mapping between WordPress and IDM |
For information on social identity provider buttons and badges, see "Social Identity Provider Button and Badge Properties".