- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我成功地分别使用了 openID 和 OAuth,但我无法让它们一起工作。
我是不是做错了什么:
String userSuppliedString = "https://www.google.com/accounts/o8/id";
ConsumerManager manager = new ConsumerManager();
String returnToUrl = "http://example.com:8080/app-test-1.0-SNAPSHOT/GAuthorize";
List<DiscoveryInformation> discoveries = manager.discover(userSuppliedString);
DiscoveryInformation discovered = manager.associate(discoveries);
AuthRequest authReq = manager.authenticate(discovered, returnToUrl);
session.put("openID-discoveries", discovered);
FetchRequest fetch = FetchRequest.createFetchRequest();
fetch.addAttribute("email","http://schema.openid.net/contact/email",true);
fetch.addAttribute("oauth", "http://specs.openid.net/extensions/oauth/1.0",true);
fetch.addAttribute("consumer","example.com" ,true);
fetch.addAttribute("scope","http://www.google.com/calendar/feeds/" ,true);
authReq.addExtension(fetch);
destinationUrl = authReq.getDestinationUrl(true);
那么 destinationUrl 就是
但在谷歌的响应中request_token 丢失
为什么?
最佳答案
在上面的代码中,您添加了 OAuth 扩展参数和属性交换扩展参数。但由于 OAuth 和 Attribute Exchange 是不同的扩展,因此您必须为 OAuth 参数创建不同的扩展消息,然后将其添加到身份验证请求消息中。
但是由于没有将 OAuth 参数添加到身份验证消息的机制,因此您必须创建这样的机制。您可以在以下链接中获取有关它的信息 http://code.google.com/p/openid4java/wiki/ExtensionHowTo
然后您可以使用以下链接中提供的代码对该机制进行硬编码 http://code.google.com/p/openid4java/issues/detail?id=110&q=oauth
关于java - 为什么在谷歌的响应中缺少使用 openid4java 的 OAuth request_token?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8315294/
我刚刚在我的 Linux 主机上编译了 QTweetLib。我已编译并运行 pinauthstatusupdate 示例,没有任何更改。但是当我尝试获取 request_token 时,我得到了: F
我目前正在为 qml 环境使用 javascript 和 OAuth 开发 Twitter 应用程序。我被困在“request_token”端点,我不明白为什么。当我发送我的请求时,我只会收到“无法验
我这里有一些代码,我收到错误 401 未经授权。我已经检查了使用 Twitter 框登录。 public async Task get_Oauth_token_TaskAsync() {
我成功地分别使用了 openID 和 OAuth,但我无法让它们一起工作。 我是不是做错了什么: String userSuppliedString = "https://www.google.com
我正在尝试为我的应用获取 oauth token 。我关注了this tutorial但我收到这样的错误: { "errors": [ { "code": 32,
尝试获取一个时收到http 403响应错误请求 token 。 我已经检查了我的基弦的歌唱过程,这是正确的。如果 我使用 Twitter 开发站点上的默认 key ,它生成相同的他们在网站上列出的结果
我已按照回复帖子 withings api authentication 的步骤中所述设置了所有内容. 但是,当我复制并粘贴在第 2 步(向 URL 发送请求:)中生成的最终 URL 时,我的浏览器没
所以,我在为我的 Angular 应用程序制作 Twitter 登录方法时遇到了问题。问题是我什至无法完成第一步。我需要向 request_token API 发出发布请求(我正在执行此步骤 http
我正在使用以下方法 URI 从 Twitter 请求 token 。 注意:这里的新行仅用于显示目的。 http://twitter.com/oauth/request_token? oauth_co
我正在尝试将 oauth 流程集成到我的应用程序中。 调用 oauth/request_token 端点时收到 401 错误: "message": "401 - {\"errors\":[{\"co
这可能是一个重复的问题,但还没有答案。库 oauth-dot-net 和 DotNetOpenAuth 都非常复杂,一个似乎贯穿 OAuth 的主题,虽然 OAuth with Verificatio
所以我正在尝试从 Twitter 获取 token ,但失败了。我收到以下错误:“无法验证 oauth 签名和 token ”。我读过这可能是由于您的系统时钟错误。在 javascript 中,我使用
我正在尝试在 NodeJS 上使用 OAuth 进行身份验证,但出现此错误: Error getting OAuth request token : { statusCode: 401, data:
我正在尝试在我的 Game Maker 应用程序中使用 Twitter 通过 OAuth 向 Firebase 验证用户(Game Maker 不支持 SDK)。 通过 REST HTTP POST
Twitter 最近刚刚强制执行以下内容: 1) 您必须将 oauth_callback 值传递给 oauth/request_token。这不是可选的。即使您已经在 dev.twitter.com
我正在编写一个简单的 Twitter 登录并尝试获取请求 token 以将用户重定向到访问 token ,但我总是以无法验证您错误结束我试图将签名添加为最后一个 header ,但它也不起作用。当我删
我尝试通过 https://api.twitter.com/oauth/request_token 请求 token 但总是收到 401 错误。 我通过 curl 进行测试(很容易看到会发生什么)。
(注意如果你不懂clojure我可以用Java翻译代码,请问) 我将 scribe 与 clojure 一起使用,我发现使用 Twitter 登录时存在一些问题,我正在使用的代码: (def twit
我正在尝试使用 RestSharp访问 Etsy 的 API。这是我用来尝试获取 OAuth 访问 token 的代码: var authenticator = OAuth1Authe
从早上开始,我就一直在努力了解如何在我的 webApp (Spring-MVC) 和 Spring-Social 之间实现登录功能。我正在使用 XML 配置,看起来效果很好。我在使用 Twitter
我是一名优秀的程序员,十分优秀!