I am developing a client app which will be authorized by SF accounts using USER AGENT FLOW. I want to achieve silent authentication wherein SF users of the account will automatically authorize themselves without any interaction. I set the connected app to allow pre authorized users to automatically approve. But I am not sure how to achieve this silently in the user side when he logs into SF. I was trying to create a iframe with src as " https://login.salesforce.com/services/oauth2/authorize?response_type=token&client_id=xyz&redirect_uri=https://SF_acc.lightning.force.com"

I have noticed two different behaviours depending on the redirect url set. 1. If I set it as https://SF-acc.lightning.force.com and current top window url is different , then top window(SF) gets reloaded. This reload is not desired. 2. If I set is as https://mydomain.com/ then mydomain.html is loaded into iframe BUT the iframe src remains as "login.salesforce.com ......"

In both the cases I am not able to get the hash value of redirected url. Can this be achieved ?

Also is there a better way to achieve this? TLDR requirements: Users of a SF account will have this js app running with SF which needs to authenticate silently without notifying the user or redirecting his page given that that user is pre authorized to access it without approval.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.