大佬教程收集整理的这篇文章主要介绍了objective-c – 我应该使用什么重定向uri(OAuth 2.0)?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
//● urn:xxxxxxx:oob //● http://localhostxxxxxx
当然,我使用这些项目并成功请求令牌谷歌.但是当我点击授权按钮时(比如“你想授权这个应用程序吗?”是的),
两个响应发生.
如果我使用urnxxxxxx,我会收到“操作无法完成.(com.google.httpStatus错误404.)”.
//Or If I use http://localhostxxxxxxxxxxxxx and click Yes button,then nothing happens.
#import "MasterViewController.h" #import "DetailViewController.h" #import "GTMOAuth2Authentication.h" #import "GTMOAuth2ViewControllerTouch.h" #import "GTMOAuth2WindowController.h" static NSString *const kKeychainItemname = @"Greader"; @interface MasterViewController () { NSMutableArray *_objects; } @end @implementation MasterViewController - (IBACtion)authentication:signInToGoogle:(id)sender; {} - (GTMOAuth2Authentication * ) authForGoogle { NSString * url_String = @"http://www.google.com/reader/api/"; NSURL * tokenURL = [NSURL URLWithString:url_String]; NSString * redirectURI = @"xxxxoob"; GTMOAuth2Authentication * auth; auth = [GTMOAuth2Authentication authenticationWithserviceProvider:@"reader" tokenURL:tokenURL redirectURI:redirectURI clientID:@"xxxxx" clientSecret:@"xxxx"]; auth.scope = @"http://www.google.com/reader/api/"; return auth; } - (void)signInToGoogle { GTMOAuth2Authentication * auth = [self authForGoogle]; NSString* auth_String = @"https://accounts.google.com/o/oauth2/auth"; NSURL * authURL = [NSURL URLWithString:auth_String]; GTMOAuth2ViewControllerTouch * viewController; viewController = [[GTMOAuth2ViewControllerTouch alloc]initWithAuthentication:auth authorizationURL:authURL keychainItemname:kKeychainItemname delegate:self finishedSELEctor:@SELEctor(viewController:finishedWithAuth:error:)]; [self.navigationController pushViewController:viewController animated:YES]; }
以上是大佬教程为你收集整理的objective-c – 我应该使用什么重定向uri(OAuth 2.0)?全部内容,希望文章能够帮你解决objective-c – 我应该使用什么重定向uri(OAuth 2.0)?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。