我是否需要在 Flickr 上进行身份验证才能检索我自己的照片集?
我对 Flickr API 访问有点困惑。我想让我的 Android 应用程序检索我在自己的 Flickr 帐户中设置为私有的照片列表。
如果照片是公开的,我目前可以检索自己的照片集,没有问题。如果照片集包含私人照片,则该照片集不会从 flickr.photosets.getList 方法返回。
考虑到我不希望最终用户进行身份验证,所以我不需要实现oAuth;我只希望我的应用程序能够访问。我是否需要进行一次身份验证并获取令牌,在我的应用程序中对令牌进行硬编码,然后向 API 发送经过身份验证的调用?
I'm sort of confused about Flickr API Access. Id like for my Android app to retrieve a list of photos that I have set as private in my own Flickr account.
I'm currently able to retrieve my own photoset if the photos are public no problem. If the photoset contains private photos, then that photoset doesn't get returned from the flickr.photosets.getList method.
Considering that I don't want the end user to authenticate, I dont need to implement oAuth; I just want my app to have access. Do I need to authenticate once and get a token, hard-code the token in my app, and then send authenticated calls to the API?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从 Flickr 的角度来看,应用程序的编码者是谁并不重要。仅当您授权您的应用程序这样做时,Flickr 才会允许您访问您的应用程序并访问您在 Flickr 上的数据。您必须至少进行一次身份验证。但是,如果令牌无效,您将无法访问数据。此外,对令牌进行硬编码会存在安全问题,除非您不担心有人访问您的私人照片。
快速的谷歌搜索给了我这个库 - http://code.google.com/p/androidflickr/< /a>
您可以尝试使用它。
From Flickr's point of view, it does not matter who coded the application. Flickr will let you access your application access your data on Flickr only when you have authorized your application to do so. You will have to authenticate once at least. However, if the token becomes invalid then you can't access the data. Also, hard coding the token has security issues unless you are not concerned about someone accessing your private photos.
A quick Google search gave me this library - http://code.google.com/p/androidflickr/
You can try using it.
您所描述的场景有时称为 2 足 OAuth。 (https://developers.google.com/identity/protocols/OAuth2ServiceAccount) < br>
Google API 通过“服务帐户”支持这一点。
不幸的是,Flickr 似乎不支持这种交互。
所以,正如你所描述的:
对于公共数据交互(例如从您的帐户下载公开照片(照片流)),无需进行身份验证。
但对于其他交互(例如从您的帐户下载私人照片(相机胶卷)),至少需要一次完整的 OAuth 过程。
The scenario which you are describing is sometimes referred to as 2-legged OAuth. (https://developers.google.com/identity/protocols/OAuth2ServiceAccount)
Google APIs support this via a 'service account'.
Unfortunately Flickr doesn't seem to support this kind of interaction.
So, as you described:
For public data interaction (like downloading your public photos (photostream) from your account), there's no need to authenticate.
But for other interactions (like downloading private photos (camera roll) from your account), full OAuth procedure is required at least once.