amazon-connect / amazon-connect-streams

Amazon Connect Streams - a browser-based contact center integration API, typically with CRM systems.
https://docs.aws.amazon.com/connect/latest/userguide/
Apache License 2.0
395 stars 315 forks source link

How to get the user logged in information using streams API #920

Closed jahnavi310 closed 2 months ago

jahnavi310 commented 2 months ago

We are using a custom CCP in an iframe and have successfully setup SSO authentication via okta defining the relay state as our current web app - this works fine.

What we need is to know who is the current logged in user, right now the only way we can think of is reading the username of from the iframe, we are not able to decode the cookie since its a federated token and not a jwt token.

Does the stream API have any way of achieving this?

Thanks in advance

L4MI4 commented 2 months ago

I believe that is handled via the agent.getConfiguration() method, you could attach it to any event handler, most preferably on agent init. You get both the name and username.

tannera926 commented 2 months ago

Correct, agent.getConfiguration() returns the agent's name, username, and arn, as well as other details.