After authenticating as displayed in the following Avaya sample (
https://www.devconnectprogram.com/site/global/products_resources/avaya_client_sdk/programming_docs/current/javascript/customer_interactive/guide/tutorial_auth.gsp) we obtain the token and attempt to pass it to the clientSession object using the clientSession.setToken() method.
authenticate(username: string, password: string) : void {
this.auth.authenticate(username,password).then(function (user, data) {
console.log('%cuser:addOnAuthenticatedCallback -> ', 'color:#00cc00;font-weight:bold', 'authenticated user');
this.start(data);
})
}
private start(data){
let token = {
header: 'Authorization',
value: 'Bearer ' + data.token
};
// Set token to SDK token store and start session
this.clientSession.setToken(token);
...
Then we try and call agent.activate('{our username}'), and receive a 401 Unauthorized error when attempting to subscribe to the broadcast URL provided in our configuration object:
AvayaCustomerServicesConfiguration: {
uacConfiguration: {
enabled: true,
clientInfo: {
id:"testApp"
},
serverInfo: {
apiUrl:"https://BREEZE-FQDN/services/UAC/UACAPI"
},
notificationInfo: {
broadcastUrl: "https://BREEZE-FQDN/services/UAC/UACAPI/broadcast"
},
authenticationInfo: {
enabled: true,
tokens: ['Authorization']
}
}
}
(It is also relevant to note that the sample broadcast url of
https://BREEZE-FQDN/services/UAC/broadcast returns a 404 unless the UACAPI portion of the URL is provided as shown).
A quick log of the clientSession object reveals that the proper configuration object is passed to it, as expected, but the value of the Authorization token returned from IdentityManagementService is not.