I'm working under our solution of the Softphone using OpenCTI. Now I need to authenticate our customer's users through our OAuth2 provider. How I understood the best practice for using external authentication service is making a Custom External Auth. Provider. But I can't figure out how I should deploy this solution to customers.

The first problem that Callback URL is generated on Auth. Provider creation and the second problem that field Execute As is required for creating Auth.Provider.

Perhaps it is OK to force customer's salesforce administrator to make some work, but I think there is another best practice for that.

1 Answer 1


It is not clear from question what system will be identity provider. If you need to authorize user in External CTI provider - you can use API to start web server OAuth flow and redirection url could be posted in state param of OAuth URL. AuthProvider required to login users in Salesforce by external creds - in CTI you have user already logged in Salesforce

So options are following:

  • Create VisualForce page to show phone layout - here you can start OAuth flow by redirecting to OAuth URL and for callback indeed you need specify right Salesforce page URL.
  • Use call center agent username and password for 'password' grant_type of OAuth
  • Embed callcenter UI inside of Salesforce with canvas app or iframe
  • Thanks, @pklochkov! We have our own identity provider. Am I right you mean that AuthProvider doesn't appropriate approach here and I should make all communications with our OAuth provider from VisualForce page? I looked at AuthProvider because I didn't find the best way to work with tokens, at least where to keep access/refresh tokens after receiving and how to refresh the access token. In addition, where I can get redirect URL to return back from authentication page? AuthProvider seems to care about these for me. Perhaps, you can point me how to solve those issues?
    – SlavaHq
    Commented Apr 3, 2019 at 10:10
  • Right. AuthProviderClass is not right approach here in docs it is used to login to Salesforce using creds for other systems.
    – pklachkou
    Commented Apr 3, 2019 at 12:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .