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
Meryem FRQMeryem FRQ 

OAuth 2.0 as Authentification Provider

Hello everyone,

We are trying to implement an authentification provider for our salesforce instance, the code we are using is pure OAuth 2.0 and we are tried to configure it using the Open ID that salesforce provide for the authentification provider. We are getting an No token error.

Do we have to switch to Open ID or can the code be adapted for OAuth ?

Thank you for the help.
SarfarajSarfaraj
Hi Meryem

Can you please share the code that you have written.

--Akram
Meryem FRQMeryem FRQ
Hi, Thank you for the reply.

We are using a Spring Framework Oauth2 implementation. Our server expose oauth2 framework endpoints for the authentication and authorization.

1- Everything is working fine with the AuthorizationEndpoint: Salesforce call is catched and user is invited to allow the testing resource for his protected ressources access.

User-added image

2- After granted user permission, the authorization code is sent to the Salesforce callback Url which never come back to retrieve a valid access token. the token endpoint is never called.

https://test.salesforce.com/services/authcallback/00Dg0000003KtH4EAK/SOO_Leyton?code=a9e9ee09-eee5-44c5-b6d1-8cdae9ea414e&state=CAAAAU3SidweME8wZzAwMDAwMDAwMDA1AAAAxMOdF_CCc7M7ovXuV9djx4ymu-Thun3R1fDKnKnZdNo9m6VQp6oiL1K4u4o7H7eN-t_RmyG7sHEMBctn14LuwuPJsoES_AdoiTxFVlQMRRZuJmtjD7McbbW_IkQwne3q9MOydfQdqqFOWerLIVx7ibhCI2-eJT2CF3YYUb6bc_sa

This is the error into the URL

https://leyton--sandbox1.cs17.my.salesforce.com/_nc_external/identity/sso/ui/AuthorizationError?ErrorCode=No_Oauth_Token&ErrorDescription=Empty+Response

Expected here: A call from Salesforce to this method in our Token Endpoint
@RequestMapping(value = "/oauth/token")
public ResponseEntity<OAuth2AccessToken> getAccessToken(Principal principal, @RequestParam
Map<String, String> parameters) { ... }
Any help to understand what action the SF callback is trying to perform will be useful.

Thanks
Meryem FRQMeryem FRQ
Any Ideas ??