The issue you're experiencing might be caused by the fact that the custom CCP is not receiving the tokens needed to authenticate the agent. It appears that the SAML response is redirected to the default Amazon Connect CCP, and the custom CCP does not receive the required information.
To resolve this issue, you can try the following approach:
- Modify your loginUrl to include the custom CCP URL in the RelayState parameter. You should encode the custom CCP URL before appending it to the RelayState parameter. Replace http://127.0.0.0:5500/ccp-v2.html with the actual custom CCP URL when you host it publicly.
var customCcpUrl = encodeURIComponent("http://127.0.0.0:5500/ccp-v2.html");
var loginUrl = "https://<domain>.uk.auth0.com/samlp/<app>?RelayState=https://<region>.console.aws.amazon.com/connect/federate/<instanceId>?destination=%2Fconnect%2Fccp-v2&customCcpUrl=" + customCcpUrl;