function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Matty BMatty B 

How to setup connected app when org is using an SSO provider

I've created a webservice via apexrest in our sandbox org that uses a Get method and returns json results. In order to do this I created a connected app and then sent a POST to /services/oauth2/token in order to get the Bearer Token to use for the web service. This worked fine on sandbox where we have no SSO setup but in Production we use Okta for SSO so therefore don't manage passwords. The POST required me to pass in the grant_type, client_id, client_secret, username, and password (which consisted of password+token). However with SSO there is no password or token managed in Production. So how do we achieve this with an SSO provider controlling the authentication?
VinayVinay (Salesforce Developers) 
Hi Matty,

Try to review below links which gives you more information.

https://saml-doc.okta.com/SAML_Docs/How-to-Configure-SAML-2.0-in-Salesforce.html
https://www.forcetalks.com/blog/setting-sso-between-salesforce-and-oktas-salesforce-com-standard-application-using-saml-2-0-protocol/

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
Matty BMatty B
Hi Vinay,
So the SSO is already setup and working for authentication. My question is more so how to implement a connected app now. in the sandbox where SSO was not implemented I would pass in the username, password, token, client_id, and consumer_secret in order to generate a Bearer token to use so that the connected app would return results.
Matty BMatty B
So my question is how to do this when there essentially is no password b/c its managed within Okta?
VinayVinay (Salesforce Developers) 
Hi Matty,

REST APIs use OAuth authentication, and you can use connected app to integrate your application with Salesforce with SSO.

Below are links for reference.

https://developer.salesforce.com/docs/atlas.en-us.salesforce_developer_environment_dotnet_tipsheet.meta/salesforce_developer_environment_dotnet_tipsheet/salesforce_developer_environment_remoteaccess.htm
https://trailhead.salesforce.com/en/content/learn/modules/connected-app-basics/connected-app-basics-api-integration

Thanks,
Vinay Kumar