@ping-identity/p14c-js-sdk-user
v1.0.0-pre.2
Published
PingOne for Customers Management API module to work with user self-management actions
Downloads
7
Readme
PingOne SDK for JavaScript Management API Module
The PingOne Management API module provides the interface to configure and manage PingOne resources through self-management scopes.
PingOne self-management scopes are applicable to users only. They are granted on authorization_code
and implicit
authorization flows.
The self-management scopes specified in an authorization request identify the resources that end users can access to perform self-management actions(the ability to interact with their own profile data).
This module includes methods to work with:
- user identity and its attributes;
- user multi-factor authentication devices;
- user identity password;
- user identity linked accounts;
- user identity pairing key.
NOTE:
THIS REPOSITORY IS IN A TESTING MODE AND IS NOT READY FOR PRODUCTION !!!
Content
Installation
To install @ping-identity/p14c-js-sdk-user you can run these commands in your project root folder:
# yarn
yarn install @ping-identity/p14c-js-sdk-user
or
# npm
npm install --save @ping-identity/p14c-js-sdk-user
Create PingOneUserApiClient
like:
const PingOneUserApiClient = require("@ping-identity/p14c-js-sdk-user");
const config = {
clientId: "someClientId",
environmentId: "someEnvironmentId",
scopes: ["p1:read:user"],
};
const userApiClient = new PingOneUserApiClient(config);
userApiClient.getAllData(userId);
, where configuration parameters are:
environmentId
: Required. Your application's Environment ID. You can find this value at your Application's Settings under Configuration tab from the admin console( extractxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
string that specifies the environment 128-bit universally unique identifier (UUID) right fromhttps://auth.pingone .com/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/as/authorize
AUTHORIZATION URL ). Or from the Settings main menu (ENVIRONMENT ID variable)clientId
: Required. Your application's client UUID. You can also find this value at Application's Settings right under the Application name.scopes
: Required. PingOne self-management scopesAPI_URI
: Optional. PingOne API base endpoint. Default value:https://api.pingone.com
AUTH_URI
: Optional. PingOne Authentication base endpoint. Default value:https://auth.pingone.com
This module works together with @ping-identity/p14c-js-sdk-auth
to get an access token after user successfully logged in.
Module API Reference
| Method Name | Description |
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| getAllData(userId)
| Get logged in user attributes |
| update (userId, user, completeUpdate = false)
| Modify logged in user attributes |
| resetPassword (userId, currentPassword, newPassword)
| Self-change reset of logged in user password |
| enableMFA (userId, enable)
| Enable or disable multi-factor authentication for logged in user|
| createSMSDevice (userId, phone)
| Add an SMS device for logged in user |
| createEmailDevice (userId, email)
| Add an email device for logged in user |
| getAllMFADevices(userId)
| Retrieve all multi-factor authentication devices for logged in user |
| deleteMFADevice (userId, deviceId)
| Delete multi-factor authentication device for logged in user |
| getAllLinkedAccounts (userId, expand = false)
| Get all linked accounts for logged in user |
| deleteLinkedAccounts (userId, linkedAccountId)
| Delete linked accounts for logged in user |
| createMFAPairingKey (userId, applicationId)
| Create a pairing key for logged in user |
| deleteMFAPairingKey (userId, pairingKeyId)
| Remove the pairing key for logged in user |
| getMFAPairingKey (userId, pairingKeyId)
| Retrieve the pairing key for logged in user |