You need to sign in to do that
Don't have an account?
VINAY KAUSHIK 14
Access Token without using username and password
Hi Guys,
How can we get the access token without passing the username and password? Also, is there any other way to get the access token from the session id or based on login?
You can use userInfo class for that,
Below is the sample code, Please let us know, if this helps.
Thanks,
Govindaraj.S
You should be able to do this without username/password using oauth 2.0.
Refer this link
https://alexbilbie.com/guide-to-oauth-2-grants/
https://help.salesforce.com/articleView?id=remoteaccess_authenticate.htm&type=5
https://help.salesforce.com/articleView?id=remoteaccess_oauth_web_server_flow.htm&type=5
The client sends a POST request with following body parameters to the authorization server:
- grant_type with the value client_credentials
- client_id with the the client’s ID
- client_secret with the client’s secret
- scope with a space-delimited list of requested scope permissions.
The authorization server will respond with a JSON object containing the following properties:This is the best link to understand oauth
https://developer.salesforce.com/index.php%3Ftitle%3DDigging_Deeper_into_OAuth_2.0_on_Force.com%26oldid%3D50717