应用程序如何在没有服务器的情况下代表用户访问 OAuth 服务(例如 Dropbox)?
How can an application access an OAuth service (such as Dropbox) on behalf of a user without having a server somewhere?
就 OAuth 访问而言,correct/recommended 实现 Dropbox 或 GoogleDrive 或任何客户端的方式是什么,仅作为客户端而没有服务器?
许多提供商(例如 Dropbox)不允许 redirect_uri 不是 http/https。在手机上,似乎 google(和苹果?)除了来自 OS 的浏览器(为了用户方便)之外不允许 OAuth 请求,这意味着应用程序捕获的唯一方法来自 oauth 的授权代码(不涉及服务器)是拦截 URI,例如“http://localhost:9876/myapplication/" by telling the OS that it wishes to intercepts such a URI. Intercepting an http URI is not possible (the OS redirects it to the browser) without a complicated/involved setup which requires a server (something like this”。
还有一个问题是必须将我的应用程序告知服务提供商并检索客户端 id/secret,我必须在应用程序中对其进行硬编码。
有一种 OAuth 授权类型,我只需获取用户的用户名和密码,然后将它们直接发送到服务器。这看起来很可疑,并且可能不会受到用户的欢迎。
正确的做法是什么?我是否需要 server/service 运行 才能创建仅作为这些服务的第三方门户的应用程序?
谢谢,
一种解决方法(如@gbazilio 的评论所建议)是通过在 web 视图中调用 oauth 端点来手动实施身份验证。要使其与 google 等服务提供商一起工作,它会阻止 webviews 的 oauth,是在对某些移动浏览器 user-agent 和所有内容的 oauth 请求中设置 user-agent header会工作得很好。
就 OAuth 访问而言,correct/recommended 实现 Dropbox 或 GoogleDrive 或任何客户端的方式是什么,仅作为客户端而没有服务器?
许多提供商(例如 Dropbox)不允许 redirect_uri 不是 http/https。在手机上,似乎 google(和苹果?)除了来自 OS 的浏览器(为了用户方便)之外不允许 OAuth 请求,这意味着应用程序捕获的唯一方法来自 oauth 的授权代码(不涉及服务器)是拦截 URI,例如“http://localhost:9876/myapplication/" by telling the OS that it wishes to intercepts such a URI. Intercepting an http URI is not possible (the OS redirects it to the browser) without a complicated/involved setup which requires a server (something like this”。
还有一个问题是必须将我的应用程序告知服务提供商并检索客户端 id/secret,我必须在应用程序中对其进行硬编码。
有一种 OAuth 授权类型,我只需获取用户的用户名和密码,然后将它们直接发送到服务器。这看起来很可疑,并且可能不会受到用户的欢迎。
正确的做法是什么?我是否需要 server/service 运行 才能创建仅作为这些服务的第三方门户的应用程序?
谢谢,
一种解决方法(如@gbazilio 的评论所建议)是通过在 web 视图中调用 oauth 端点来手动实施身份验证。要使其与 google 等服务提供商一起工作,它会阻止 webviews 的 oauth,是在对某些移动浏览器 user-agent 和所有内容的 oauth 请求中设置 user-agent header会工作得很好。