function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
bhbh 

"expired access/refresh token" during OAuth 2.0 Username-Password Flow

Hi,

 

I need help avoiding username /password prompt.

 

I'm creating an Android App which will post some minor updates to salesforce on a regular basis. I need the app to open without user interaction (assume the phone is locked in a box and so user interaction is not an option).

 

My problem is that the Mobile SDK requires username and password. I'm looking for some way to hard code that into my app. Any ideas welcome,

Thanks,

Ben

Gaurav KheterpalGaurav Kheterpal

Ben,

 

This is a good starting point.

 

http://brianpeddle.com/2011/06/06/building-a-custom-salesforce-login/

 

You can actually go one step further and then hardcode the credentials while bypassing the Salesforce oAuth webview altogether.

 

I hope this helps.

 

Regards,

Gaurav

bhbh

Thank you so much for this post!