gpt4 book ai didi

objective-c - Yahoo OAuth 与 Mac 应用程序的 gtm-oauth

转载 作者:行者123 更新时间:2023-12-03 17:25:15 25 4
gpt4 key购买 nike

有人成功用过gtm-oauth向 Yahoo 进行身份验证以获取桌面 Mac 应用程序?我能够使用这个库向 Twitter 进行身份验证,并且我觉得我已经对 Yahoo OAuth 进行了适当的更新,但是当我启动请求并且未显示 View Controller 时,我始终收到 401 错误。

我已更新 OAuthSample 项目中的值,如下所示:

NSURL *requestURL = [NSURL URLWithString:@"https://api.login.yahoo.com/oauth/v2/get_request_token"];
NSURL *accessURL = [NSURL URLWithString:@"https://api.login.yahoo.com/oauth/v2/get_token"];
NSURL *authorizeURL = [NSURL URLWithString:@"https://api.login.yahoo.com/oauth/v2/request_auth"];
NSString *scope = @"https://api.login.yahoo.com";

有人有什么建议吗?

最佳答案

Yahoo 的 OAuth 服务器不需要显示名称或范围参数。

要将 GTMOAuth 与 Yahoo 的 OAuth 1 服务器一起使用,请将范围和显示名称设置为 nil,例如

windowController = [[[GTMOAuthWindowController 分配] initWithScope:nil 语言:无 请求 token URL:请求URL 授权 token URL:授权URL accessTokenURL:accessURL 身份验证:auth 应用程序服务名称:kYahooKeychainItemName ResourceBundle:nil]自动释放];

[auth setDisplayName:nil];

此外,请确保身份验证回调 URL 与在 Yahoo 注册的 URL 匹配。

关于objective-c - Yahoo OAuth 与 Mac 应用程序的 gtm-oauth,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7546096/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com