-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't Authenticate #1
Comments
Hi @bobbywhitesfdc , I have same callback URL in the configuration as shown, but the problem is initiate() method is returning generatedURL which is https://{salesforce-hostname}/services/authcallback/Apigee?code=999&state=XXXXX..... Still I am getting error saying "We can’t log you in because of an authentication error. For help, contact your Salesforce administrator." Can you please help me if I am doing anything wrong here? |
|
Hi @bobbywhitesfdc, Thanks for the prompt reply!
But one thing which I am not able to understand is the authorization which is taking place which is in the initiate() method is not needed for the API I have been provided with. They just need the auth key and token URL to get the auth token. Is there anyway we can bypass the initiate method and still authenticate? |
The AuthProvider interface is pretty rigid. Essentially it was design for interactive "OAuth 2.0 Web-Server Flow". Non-interactive flows like Client Secret or JWT Bearer flow just have to "fake out" the steps that aren't needed. https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_Auth_AuthProviderPluginClass.htm https://help.salesforce.com/articleView?id=remoteaccess_oauth_flows.htm&type=5 When you are troubleshooting and looking at the Debug Logs, paying attention to the Debug Messages that signal how far you've progressed will be key to correcting the configuration.
|
Hi @bobbywhitesfdc , Thank you so much for guidance. I was able to get the auth token by modifying the initiate() method and the HTTP request parameters. Thanks! |
Hi @bobbywhitesfdc, After successfully authenticating the Named Credentials as per your guidance above, I kept the scope as "refresh_token full" for auto-refreshing the Auth Token. But it seems to be not working as expected. It should refresh Auth Token automatically and when the token expires, the following error is received on APIGEE end "Error 401: Provided JWT Token might be expired, Please provide a new JWT Token". Can you please help me understand if this is something needs to done APIGEE or SF? |
hi @svk1993d, |
Hi @bobbywhitesfdc , Thank you for the approach. I have done the changes as per your suggestion and will wait for tomorrow to check if this is working or not. Regards |
Hi @bobbywhitesfdc , I tried with the above approach but this also seems to be not working. The named credential is still not able to get a refreshed Auth Token after expiry. Thanks |
The expected behavior here is that the Salesforce platform would automatically detect when the AuthToken is expired and would attempt to refresh it. This AuthProvider implementation treats the "refresh" attempt the same way it treats the initial authtoken request. It starts from scratch and doesn't use a refresh token. I'm not sure why you're having this trouble. See:
|
Hi @bobbywhitesfdc , Thank you so much Bobby for the help. It worked finally! Regards |
Hi @bobbywhitesfdc , I have set up a custom Auth provider using the recommended solution in this repo, I used named creds but I am not able to authenticate the Named Cred and getting below error. Any help that you may provide is really appreciated. Remote_Error: The remote service returned an error** |
That's pretty vague -- can you provide any debug logs?
|
I apologize for being less detailed, I got it through and my Named cred is now Authenticated. I understand it could be because of multiple reasons but I want to ensure that we can send the OAuth token in this flow using Credential.OAuthToken because when I add debug log to get the value of this, I get just text printed as Credential.OAuthToken |
@bobbywhitesfdc , I got this working now. Thanks for helping. |
For the benefit of others, can you outline what steps you took to debug and resolve? |
Hi svk1993d, could you please tell me how you fixed the problem with refreshing the token after is getting expired, I'm having this problem right now. |
Thanks MyF5 component got authenticated. I wanted to see the logs of Custom Auth Provider plugin when I use the client Creds in Making api calls. I hv put a trace for "Execute As" user but not logged. is there any way ? |
@bobbywhitesfdc Hi Bobby! we were trying to deploy to our SB. However, we run into the following issues. Could you advise? Error temp/authproviders/ApigeeEval.authprovider ApigeeEval In field: ExecutionUser - no User named test-6iucnwrlikht@example.com found |
Hi @utkarshdixit10 , I am facing the same issue as you have mentioned to be resolved earlier Can you kindly provide the steps to debug and resolve this issue. |
@m-bolledla so do I, exaclty the same error, i've checked all parameters, looks fine, but im not able to debug handleCallback method, i do not even know if this method fires or not @utkarshdixit10 @bobbywhitesfdc can you help us? |
@utkarshdixit10 Can you please let me know the steps how you resolved the issue **We can’t log you in because of the following error. For more information, contact your Salesforce administrator. Remote_Error: The remote service returned an error** |
Auth Provider fails to connect through the UI. Callback post displays a cryptic message in a browser page.
The text was updated successfully, but these errors were encountered: