Cross site user authentication

We have a specific requirement where we need to show okta login on a site (Sitecore) and user should redirect back to different site (salesforce)on different domain. This is cross domain user authentication.

we opted to use below script for embedding widget into our Sitecore site

GitHub - okta/okta-signin-widget: HTML/CSS/JS widget that provides out-of-the-box authentication UX for your organization's apps · GitHub

callback functionalities like token exchange will be handled by salesforce. Is this approach correct? here redirect has been handled by salesforce site which does not hosts okta widget,

any suggestions?

Hi,

The AuthJs library is supposed to handle the entire OIDC transaction, including initiating the Authorisation flow, making the Token request, and handling tokens. If you are able to achieve this in your setup, I don’t see a problem with the implementation. So make sure that the Salesforce site is using the token exchange with the same instance of the AuthJS (which initiated the request in Sitecore). Otherwise, you will face issues with the library.