Generate eGain OAuth Tokens
To connect eGain to a Knowledge Hub knowledge base, you must either provide your eGain credentials to NiCE Professional Services or enter them in Knowledge Hub yourself. This page describes how to configure Basic and OAuth 2 authentication methods in the eGain interface. Basic authentication uses a username and password for direct access, while OAuth 2 is a token-based method that enables eGain to request and use access tokens for secure communication with Knowledge Hub.
Configuring Basic Authentication in eGain
To configure Basic authentication:
-
In eGain, from the navigation menu, go to Integration > External Apps > Authentication.
-
On the List page toolbar, select New.
-
On the Properties page, under the General tab, enter the following:
-
Name: Enter a name for the configuration.
-
Description: Enter a brief description.
-
Authentication type: Select Basic.
-
-
On the Configuration tab, enter the following:
-
User Name: Enter the username for the account used by the data adapter.
-
Password: Enter the password for the account used by the data adapter.
-
-
Click Save to save the configuration.
Configuring OAuth2 Authentication in eGain
Create a new authentication configuration.
-
In eGain, from the navigation menu, go to Integration > External Apps> Authentication.
-
On the List page toolbar, click New.
-
On the Properties page, under the General tab, enter the following:
-
Name: Enter a name for the configuration.
-
Description: Enter a brief description.
-
Authentication type: Select OAuth2.
-
-
On the Configuration tab, enter the following:
Field name
description
OAuth2 ClientId Enter the unique string representing the registration information provided by the service provider. OAuth2 ClientSecret Enter the secret string provided by the service provider to authorize the client requesting an access token. Refresh Token
Enter the credential used to obtain new access tokens when the current token expires. Token Request URL Enter the URL used to request the access token. This field is required. Method Select POST or GET based on what the client authentication server supports.
If GET is selected, the Content-Type and Token Request Body fields are disabled.
Content-Type Select the format of the request content. Options include:
-
application/json
-
application/xml
-
application/x-www-form-urlencoded
Token Request Body Provide the parameters for the token request body. Format the string as:
client_id=<client_id>&client_secret=
<client_secret>&refresh_token=
<refresh_token>&grant_type=refresh_token
Access Token JSON Path Enter the JSON path to extract the access token from the response. For example: $.access_token Access Token (Optional) Enter a current access token if available. Leave blank to allow the application to request a new token using the provided details. Headers Add any additional headers excluding the content-type by entering a Name and Value, then selecting Add. These headers will be included in the token request. -
-
Click Save.
Login to CXone Mpower Using eGain Authentication
eGain is configured with a mock API in CXone Mpower because valid client credentials are not available.
-
In the Knowledge Hub section, go to Source Configurations.
-
From the Knowledge Source drop-down, select eGain.
-
Set the Authentication Type to either BASIC or OAUTH2.
-
Based on the selected authentication type, enter the required details:
-
If you selected BASIC:
-
Username
-
Password
-
Portal ID
-
-
If you selected OAUTH2:
-
Portal ID
-
Client ID
-
Client Secret
-
Access Token
-
Auth Code
-
Refresh Token
-
-
Set the Sync Frequency to Every Day.
-
Click Save to apply the configuration.