You need to sign in to do that
Don't have an account?
Drcete
Generate oauth token programatically?
Hello
Is it possible to generate an OAuth access token programmatically (as it's generated with the username-password flow) for a user that performs certain action from a visualforce page?
Where are these tokens stored?
I need to send this token to an external service to perform an API call.
I'm trying to avoid making the user type his username/password again.
Is it possible to generate an OAuth access token programmatically (as it's generated with the username-password flow) for a user that performs certain action from a visualforce page?
Where are these tokens stored?
I need to send this token to an external service to perform an API call.
I'm trying to avoid making the user type his username/password again.
Use the username-password flow to get the token. Using then user don't need to verify again on screen. But this will be the same for all users and also you might need a dummy user for this.
Second, you can use the JWT token to authenticate the user and run the flow. I prefer this over the other.
For reference check this too,
https://help.salesforce.com/articleView?id=sf.remoteaccess_oauth_jwt_flow.htm&type=5
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.