+1 vote
1 view
in Salesforce by (11.9k points)

I am examining a sample which is in the salesforce developer site.

In that sample when we click a link it will be redirected to the salesforce login page. If the login successful, then an access token is issued.

I dont want my application to redirect to the salesforce login page. In the existing sample the environment variable is set to,

"https://login.salesforce.com"

What should I do to avoid redirecting to salesforce login page.

1 Answer

+1 vote
by (32.1k points)
edited by

It seems that you need to implement OAuth 2.0 username-password flow in order to avoid redirection. 

Want to learn Salesforce from basics! Here's the right video for you on Salesforce provided by Intellipaat:

Try the following code to solve your problem:

{"id":"https://login.salesforce.com/id/00Dx0000000BV7z/005x00000012Q9P",

"issued_at":"1278448832702","instance_url":"https://yourInstance.salesforce.com/",

"signature":"0CmxinZir53Yex7nE0TD+zMpvIWYGb/bdJh6XfOH6EQ=","access_token":

"00Dx0000000BV7z!AR8AQAxo9UfVkh8AlV0Gomt9Czx9LjHnSSpwBMmbRcgKFmxOtvxjTrKW1

9ye6PE3Ds1eQz3z8jr3W7_VbWmEu4Q8TVGSTHxs","token_type":"Bearer"}

Related questions

0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...