Setting Up Vkontakte as an IDM Social Identity Provider

Note

When you configure a Vkontakte app, look for an Application ID and a Secure Key. IDM uses this information as a clientId and clientSecret, respectively.

Set Up Vkontakte

To set up Vkontakte as a social identity provider, navigate to the following Vkontakte page: Vkontakte Developers Page . You'll need a Vkontakte account. Find a My Apps link. You can then create an application with the following information:

  • Title (The name of your app)

  • Platform (Choose Website)

  • Site Address (The URL of your IDM deployment, such as http://openidm.example.com:8080/

  • Base domain (Example: example.com)

  • Authorized Redirect URI (Example: http://openidm.example.com:8080/)

  • API Version; for the current VKontakte API version, see VK Developers Documentation, API Versions section. The default VKontakte API version used for IDM 7.1 is 5.73.

If you leave and need to return to Vkontakte, navigate to https://vk.com/dev and select My Apps. You can then Manage the new apps that you've created.

Navigate to the Settings for your app, where you'll find the Application ID and Secure Key for your app. You'll use that information as shown here:

  • Vkontakte Application ID = IDM Client ID

  • Vkontakte Secure Key = IDM Client Secret

Configure a Vkontakte Social Identity Provider

  1. To configure a Vkontakte social identity provider, log in to the Admin UI and navigate to Configure > Social ID Providers.

  2. Enable the Vkontakte social identity provider.

    In the Vkontakte Provider pop-up that appears, the values for Redirect URI should match the values that you've entered for Authorized Redirect URI in "Set Up Vkontakte".

  3. Include the values that Vkontakte created for Client ID and Client Secret, as described in "Set Up Vkontakte".

  4. Under regular and Advanced Options, include the options shown in the following appendix: "Vkontakte Social Identity Provider Configuration Details".

When you enable a Vkontakte social identity provider in the Admin UI, IDM generates the identityProvider-vkontakte.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 information from the Consumer Key and Consumer Secret, you'll see them as clientId and clientSecret, respectively, in the configuration file.

{
    "provider" : "vkontakte",
    "configClass" : "org.forgerock.oauth.clients.vk.VKClientConfiguration",
    "basicAuth" : false,
    "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>"
            }
        }
    },
    "authorizationEndpoint" : "https://oauth.vk.com/authorize",
    "tokenEndpoint" : "https://oauth.vk.com/access_token",
    "userInfoEndpoint" : "https://api.vk.com/method/users.get",
    "redirectUri" : "http://openidm.example.com:8080/",
    "apiVersion" : "5.73",
    "scope" : [
        "email"
    ],
...

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 Vkontakte social identity, you can verify this by selecting Manage > Vkontakte, 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: "Vkontakte Social Identity Provider Configuration Details".

Configure User Registration to Link to Vkontakte

Once you've configured the Vkontakte 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.

Vkontakte Social Identity Provider Configuration Details

You can set up the Vkontakte social identity provider through the Admin UI or in a conf/identityProvider-vkontakte.json file. IDM generates the identityProvider-vkontakte.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 Vkontakte Provider pop-up window, along with associated information in the identityProvider-vkontakte.json file:

Vkontakte Social Identity Provider Configuration Properties
Property (UI)Property (JSON file)Description
Application IDclientIdThe client identifier for your Vkontakte App
Secure KeyclientSecretUsed with the Client ID to access the applicable Vkontakte API
ScopescopeAn array of strings that allows access to user data.
Authorization EndpointauthorizationEndpointTypically https://oauth.vk.com/authorize.
Token EndpointtokenEndpointEndpoint that receives a one-time authorization code, and returns an access token; typically "https://oauth.vk.com/access_token
User Info EndpointuserInfoEndpointEndpoint that transmits scope-related fields; typically https://api.vk.com/method/users.get
API VersionapiVersionVersion of the applicable VKontakte API, available from VK Developers Documentation, API Versions section. The default VKontakte API version used for IDM 7.1 is 5.73.
Not in the Admin UIproviderName of the social identity provider
Not in the Admin UIconfigClassConfiguration class for the authentication module
Not in the Admin UIbasicAuthWhether to use basic authentication
Not in the Admin UIauthenticationIdKeyThe user identity property, such as id
Not in the Admin UIpropertyMapMapping between Vkontakte and IDM

For information on social identity provider buttons and badges, see "Social Identity Provider Button and Badge Properties".

Read a different version of :