Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma - OpenAuth
- - (GTMOAuthAuthentication *)myCustomAuth {
- GTMOAuthAuthentication *auth;
- auth = [[[GTMOAuthAuthentication alloc] initWithSignatureMethod:kGTMOAuthSignatureMethodHMAC_SHA1
- consumerKey:myConsumerKey
- privateKey:myConsumerSecret] autorelease];
- // setting the service name lets us inspect the auth object later to know
- // what service it is for
- auth.serviceProvider = @"Custom Auth Service";
- return auth;
- }
- - (void)signInToCustomService {
- #if 1
- 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";
- NSString* scope = nil;
- GTMOAuthAuthentication *auth = [self myCustomAuth];
- [auth setCallback:@"http://www.yahoo.com"];
- [auth setDisplayName:nil];
- #endif
- // Display the autentication view
- GTMOAuthViewControllerTouch *viewController;
- viewController = [[[GTMOAuthViewControllerTouch alloc] initWithScope:scope
- language:nil
- requestTokenURL:requestURL
- authorizeTokenURL:authorizeURL
- accessTokenURL:accessURL
- authentication:auth
- appServiceName:@"FantasyStats"
- delegate:self
- finishedSelector:@selector(viewController:finishedWithAuth:error:)] autorelease];
- [[self navigationController] pushViewController:viewController
- animated:YES];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement