Authentication Troubleshooting
As you develop your Live Experience app you will run into bugs related to authentication and token handling.
- REST Authentication Failure
If your credentials (
client_id
andclient_secret
) are invalid, the REST API will issue a 401 HTTP response code with the following payload:{"description":"Incorrect client credential","error":"invalid_client"}
Verify your credentials match those in the Live Experience tenant Admin Console.
- Authentication Succeeds but Call Times Out
If your application-side client uses the same logon credentials as for Associate Desktop, authentication will succeed and you can make calls from your app to Live Experience, but calls will remain stuck in the "Connecting" state and the call will time out.
In brief, calls will fail to connect because you can't call yourself.
To resolve this issue, in the SDK, ensure that
CommunicationFragment.service.serUserID("emailAddress")
is set to a different email address than the one you use to authenticate with Live Experience. - Network Issues in the SDK
Once you have passed a token to the SDK it is used for the SDK's own network requests. If these network requests fail the Live Experience SDK provides no notification to your application. The only way to see if a failure has occurred is to monitor the console log of your application for HTTP response errors. Here are some common failure scenarios and how they appear in the console.
Note: These examples use the iOS console. The JavaScript and Android consoles produce similar error messages.- Scenario Does Not Exist Live Experience allows you to define engagement scenarios for your application. You select the engagement scenario you want to use by setting the *
appLocation
* context attribute in the SDK. If you choose a scenario that has not been defined in the Admin Console, the widget will not appear. When this happens, look for HTTP status code 404 in the console:OracleLive | ERROR | ScenarioClient.swift:setupScenario(completionHandler:):46 | Error when fetching scenario. HTTP Response Status code: 404 OracleLive | ERROR | ScenarioClient.swift:setupScenario(completionHandler:):51 | Http response status is not correct Optional(<NSHTTPURLResponse: 0x6040000306a0> { URL: https://live.oraclecloud.com/tenant/api/tenants/Demo1/match-meta-scenario/?version=18.3.2 } { Status Code: 404, Headers { OracleLive | ERROR | Controller.swift:updateScenario(completionHandler:):697 Could not get scenario Collaboratio: Error Domain=OracleLive Code=101 "(null)" OracleLive | ERROR | ScenarioClient.swift:setupScenario(completionHandler:):46 | Error when fetching scenario. HTTP Response Status code: 404 OracleLive | ERROR | ScenarioClient.swift:setupScenario(completionHandler:):51 | Http response status is not correct Optional(<NSHTTPURLResponse: 0x604000033420> { URL: https://live.oraclecloud.com/tenant/api/tenants/Demo1/match-meta-scenario/?version=18.3.2 } { Status Code: 404, Headers { OracleLive | ERROR | Controller.swift:updateScenario(completionHandler:):697 | Could not get scenario Collaboratio: Error Domain=OracleLive Code=101 "(null)"
- Wrong Tenant Specified You specify your Live Experience tenant by setting the
Controller.shared.service.tenantID
attribute. If the access token you retrieved is for a different tenant, HTTP status 500 will appear:OracleLive | ERROR | AvailabilityClient.swift:getAvailability():44 | Error when fetching agent availability. Status code: 500 OracleLive | ERROR | AvailabilityClient.swift:getAvailability():49 | Http response status is not correct Optional(<NSHTTPURLResponse: 0x60000003d540> { URL: https://live.oraclecloud.com/tenant/api/tenants/Demo1/application/?version=18.3.2 } { Status Code: 500, Headers {
-
Invalid Token
If you pass a token that has already expired to the Live Experience SDK, you will see HTTP status 401 in the console:OracleLive | ERROR | ScenarioClient.swift:setupScenario(completionHandler:):46 | Error when fetching scenario. HTTP Response Status code: 401 OracleLive | ERROR | ScenarioClient.swift:setupScenario(completionHandler:):51 | Http response status is not correct Optional(<NSHTTPURLResponse: 0x600000430300> { URL: https://live.oraclecloud.com/tenant/api/tenants/Demo1/match-meta-scenario/?version=18.3.2 } { Status Code: 401, Headers {
- Call Attempt After a Token Has Expired If your token expires after the widget is already displayed in your app, nothing will happen. If you click on the call button, however, you will see the following console error message:
OracleLive | ERROR | CallQueueClient.swift:pushContext():184 | Response 401, fail
You will also see a system message notification in your application UI.
- Scenario Does Not Exist