oAuth2问题在Salesforce PhoneGap iPhone应用程序(远程访问应用程序授权问题) [英] oAuth2 Issue in Salesforce PhoneGap iPhone Application (Remote Access Application Authorization Issue)

查看:298
本文介绍了oAuth2问题在Salesforce PhoneGap iPhone应用程序(远程访问应用程序授权问题)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用PhoneGap创建了一个iPhone应用程序。我已遵循本教程中的代码:



是回调的存根URL - 这是你看到的屏幕,access_token变量是你的用户的会话ID。因此,OAuth流程正常工作。



在代码中,您可以检查:

  oauthResponse.access_token 

设置正确。如果是这样,它看起来像:

  sfw.login(setupHomeView); 

是什么让它从该页面移动到下一个UI页面。



您还可以查看Force.com Mobile SDK:
http ://developer.force.com/MobileSDK



它还包括PhoneGap,并且内置了一个伟大的OAuth包装器。


I have created an iPhone application using PhoneGap. I have followed code from this tutorial:

Building PhoneGap Mobile Applications Powered by Database.com

I have logged in successfully and got struck in this screen:

I am unable to move to other screens to access data. Here is the url that got generated after successful login:

https://login.salesforce.com/services/oauth2/success#access_token=0000&refresh_token=0000&instance_url=https%3A%2F%2Fna12.salesforce.com&id=https%3A%2F%2Flogin.salesforce.com%2Fid%000C&issued_at=0000&signature=qqqq&scope=id+api+refresh_token

Do I need to add cosumer key to this url? Here is my callbackurl:

https://login.salesforce.com/services/oauth2/success

What would be the problem? Did I miss anything?

解决方案

So https://login.salesforce.com/services/oauth2/success is a stub URL for callbacks - and that is the screen you are seeing there, and the access_token variable is your session ID for the user. So the OAuth flow is working correctly.

In the code, you might check to see if:

oauthResponse.access_token

Is getting set correctly. If so it looks like:

sfw.login( setupHomeView );

Is what should tell it to move from that page to the next UI page.

You might also check out the Force.com Mobile SDK: http://developer.force.com/MobileSDK

It also includes PhoneGap and has a great OAuth wrapper built in.

这篇关于oAuth2问题在Salesforce PhoneGap iPhone应用程序(远程访问应用程序授权问题)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆