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
John T.John T. 

OAuth 2.0 username-password flow HELP

Hi Guys,

 

I'm new to IOS development and I had already use the OAuth 2.0 using the User-Agent flow. However, I would like to use the username and password flow in which I will use the saved username and password to have access to dashboard file. Please help me, I've been researching these through google for days and I still have no Lead.

cloudcodercloudcoder

check out the mobile SDK libraries for iOS (http://developer.force.com/mobilesdk). This handles what you need.

dip7uldip7ul

Could not locate any example application using the username password+token, the only sample and in in the videos every where they are talking about the preferred Oauth standard usage. I would be very glad if any one can kindly point me to any sample on the net or otherwise.

thanks & regards

Barman

John T.John T.

Use this in your post method 

 

"grant_type=password&client_id=YOURAPPLICATIONID&client_secret=YOURAPPLICATIONSECRETKEY

&username=YOURUSERNAME&password=YOURPASSWORD"

 

You need to create first your remote access application to do this

WEN JIEWEN JIE

Hi John

 

I have met the same problem, I want to use username-password flow in my android app. But so far I don't konw what I can do.

I have already ahcieve the username-password flow with a web dynamic project, but in this demo I can change the PostMethod which supplied by commons-httpclient.jar.

 

But I don't know how to change it in mobileSDK.

 

Do you reslove the problem now?

 

Thank you.

John T.John T.

You want to override the current mobile sdk authentication to a custom login right? I haven't tried it in android as for IOS, I just created a simple HTTPRequest and get the session Id of it.

WEN JIEWEN JIE

Yes, I want to use the username-password flow with MobileSDK(rewrite some method), but so far it seems impossible.

John T.John T.

I haven't tried the mobile sdk yet. I suggest you create a custom app and fetch salesforce data via the rest api.