This is an authentication API, which can be used by the customers to login using Single Sign-On (SSO) to access Interaction APIs and Access APIs. This API supports logging in using a SAML2 bearer token using OAuth2. To use this API for customer login, Customer Single Sign-On Configuration must be configured by the administrator. Refer to "Customer Single Sign-On" section in "Administrator`s Guide to Administration Console" for more information.
Upon successful verification of the SAML assertion, this API will generate a session ID which will be returned as a header. This session ID can be used by the customers to access Customer Portal APIs as well as Access APIs. Session ID, once expired, cannot be used again and a new session ID can be created by using this API.
As part of login using SSO, customer auto provisioning is also supported. With auto provisioning, customer attributes sent in SAML assertion will be used to create customers the first time they try to log in. If the customer exists, customer attributes sent in SAML assertion will be updated for the identified customer.
15.0.2.1
Method | URL | Description |
---|---|---|
POST | /ws/v15/context/authentication/user/sso/oauth2/token | Authenticates customers logging into the application using SSO. |
Following licenses will be consumed as part of this API. These must be installed and available for consumption:
Name | Description | Allowed values | Default value |
---|---|---|---|
Content-Type | Media type sent by the client. | application/x-www-form-urlencoded | N/A |
Accept | Content type accepted by the client. | application/xml or application/json | N/A |
Accept-Language | Language locale accepted by client (used for locale specific fields in resource representation and in error responses) | Supported 'Accept-Language' header codes | default system language |
The request body is mandatory. Request body must contain a single form with the following parameters:
Note: An attribute 'applicationType' can optionally be provided in SAML assertion. This indicates the application which the customer wants to login to. Only Secure Inbox is currently supported, and hence, its value must be 'secure_inbox'.
If a customer is not found in the ECE application with the subject provided in the SAML assertion, the application will check whether mergeOnAttribute SAML attribute is provided. If provided, the application uses the field specified in mergeOnAttribute to search for a customer.
If a customer is found using mergeOnAttribute then this customer's information will be updated with all the customer attributes sent in the SAML Assertion and the customer identifier sent in the subject. If the customer is not found using subject and mergeOnAttribute both, a new customer is created in the application. The customer type will be individual.
Following customer attributes are required to be sent in the SAML attributes to create a new customer successfully:
Attribute Name | Description |
---|---|
department | Department name in which to lookup the customer. This must be provided only if the customer departmentalization setting is enabled in the application. |
firstName | First name of the contact. Must not exceed 124 characters. |
Following optional customer attributes are allowed in the SAML attributes to create a new customer:
Attribute Name | Description |
---|---|
middleName | Middle name of the contact. Must not exceed 124 characters. |
lastName | Last name of the contact. Must not exceed 124 characters. |
dateOfBirth | Must be a date in the past. Must be in XML date format (yyyy-mm-dd). |
custom.<name> | Custom attributes of the contact: "<name>" is the internal name of the custom attribute. Name must match one of the custom attributes configured in application. If the custom attribute is configured as an enumeration, the value must be one of the predefined values. For string type of custom attribute that is not configured as an enumeration, refer list of Allowed Characters For Custom Attributes. |
email.address | Email address of the contact. Refer Email Address definition for the valid email address format. |
twitter.ID | Twitter ID of the contact. Must not exceed 255 characters. |
facebook.ID | Facebook ID of the contact. Must not exceed 255 characters. |
instagram.ID | Instagram ID of the contact. Must not exceed 255 characters. |
appleOpaqueId.ID | Apple Opaque ID of the contact. Must not exceed 255 characters. |
home.phone.countryCode | Country code of the home phone number of the contact. Must be a number not exceeding 9 digits. |
home.phone.number | Home phone number of the contact. This accepts any string representation. It is the client's responsibility to send in the correct number. Must not exceed 25 characters. |
mobile.phone.countryCode | Country code of the mobile phone number of the contact. Must be a number not exceeding 9 digits. |
mobile.phone.number | Mobile phone number of the contact. This accepts any string representation. It is the client's responsibility to send in the correct number. Must not exceed 25 characters. |
office.phone.countryCode | Country code of the office phone number of the contact. Must be a number not exceeding 9 digits. |
office.phone.number | Office phone number of the contact. This accepts any string representation. It is the client's responsibility to send in the correct number. Must not exceed 25 characters. |
externalId | A unique external ID for the contact person. If customer departmentalization is enabled in the application, this must be unique in the department of the customer. If customer departmentalization is not enabled, this must be unique in the application. Must be at least 1 character, and must not exceed 255 characters. Refer list of Allowed Characters. |
mergeOnAttribute | Attribute on which existing customer records will be merged. Supported values are:
|
If a single customer is found in the ECE application with the subject provided or by using the mergeOnAttribute in the SAML assertion, the customer information is updated using the customer attributes in SAML attributes and the customer identifier sent in the subject.
Following optional customer attributes are allowed in the SAML Attributes to modify an existing customer:
Attribute Name | Description |
---|---|
department | Department name in which to lookup the customer. This must be provided only if the customer departmentalization setting is enabled in the application. |
firstName | First name of the contact. Must not exceed 124 characters. Must be provided to create a new customer in the application. |
middleName | Middle name of the contact. Must not exceed 124 characters. |
lastName | Last name of the contact. Must not exceed 124 characters. |
dateOfBirth | Must be a date in the past. Must be in XML date format (yyyy-mm-dd). |
custom.<name> | Custom attributes of the contact: "<name>" is the internal name of the custom attribute. Name must match one of the custom attributes configured in application. If the custom attribute is configured as an enumeration, the value must be one of the predefined values. For string type of custom attribute that is not configured as an enumeration, refer list of Allowed Characters For Custom Attributes. |
email.address | Email address of the contact. Refer Email Address definition for the valid email address format. |
twitter.ID | Twitter ID of the contact. Must not exceed 255 characters. |
facebook.ID | Facebook ID of the contact. Must not exceed 255 characters. |
instagram.ID | Instagram ID of the contact. Must not exceed 255 characters. |
appleOpaqueId.ID | Apple Opaque ID of the contact. Must not exceed 255 characters. |
home.phone.countryCode | Country code of the home phone number of the contact. Must be a number not exceeding 9 digits. |
home.phone.number | Home phone number of the contact. This accepts any string representation. It is the client's responsibility to send in the correct number. Must not exceed 25 characters. |
mobile.phone.countryCode | Country code of the mobile phone number of the contact. Must be a number not exceeding 9 digits. |
mobile.phone.number | Mobile phone number of the contact. This accepts any string representation. It is the client's responsibility to send in the correct number. Must not exceed 25 characters. |
office.phone.countryCode | Country code of the office phone number of the contact. Must be a number not exceeding 9 digits. |
office.phone.number | Office phone number of the contact. This accepts any string representation. It is the client's responsibility to send in the correct number. Must not exceed 25 characters. |
externalId | A unique external ID for the contact person. If customer departmentalization is enabled in the application, this must be unique in the department of the customer. If customer departmentalization is not enabled, this must be unique in the application. Must not exceed 255 characters. Refer list of Allowed Characters. |
mergeOnAttribute | Attribute on which existing customer records will be merged. Supported values are:
|
Name | Description |
---|---|
forceLogin | This is an optional query parameter. The only possible value is "yes". In the application, a maximum of 5 concurrent sessions are allowed for a customer. The sixth request will fail, unless this parameter is sent along with the request. If this parameter is sent by the client, the oldest session (based on session creation time) is terminated and a new session is created. |
providerId | This is an optional query parameter. If provided, this must contain the ID of the provider to be used for authenticating the request. If this parameter is not provided, default provider will be used for authenticating the request. |
None
The Base64 decoded assertion form parameter sent in the request body must conform to SAML 2.0 assertion schema. It is assumed that all mandatory SAML assertion elements required to successfully verify the SAML assertion will be sent in the request.
Response will contain the following elements in case of success:
Response will contain the following elements in case of error:
Name | Description | Possible values |
---|---|---|
X-egain-session | Newly generated session ID | N/A |
Content-Type | Media type of response body | application/xml or application/json |
200 - OK
400 - Bad Request, with error value "invalid_request"
400 - Bad Request, with error value "unsupported_grant_type"
401 - Unauthorized with error as "invalid_grant"
403 - Forbidden with error as "access_denied"
406 - Not Acceptable, with error as "invalid_request"
500 - Internal server error, with error as "server_error"
Example 1 - Login an existing customer using SSO
Example 2 - Login a new customer with supported query parameters
Example 3 - Login an existing customer using SSO with customer updation