I am trying to query a field in visual force page using Javascrip and HTTP Requests (Rest API OAUTH 2.0). But I am not sure how I can get the access Token or the Bearer automatically after every time a user logs in. every how long does the Access token get expired? how can I use their password and username to make the first handshake and grab the access token. I am kind of all over place on this. This needs to be in Ajax, and get the results back in JSON I am trying doing this inside salesforce using visual force page. Its not an outside App
I have read this but I dont wanna use any class for this https://developer.salesforce.com/blogs/developer-relations/2015/07/using-apex-to-integrate-salesforce.html
I just wanna know how I can get the access token for different user one they login and go to the apex page without the user give a permission
I dont wanna do APP https://developer.salesforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com