AFOAuth2Client (AFNetworking 拡張機能) を介して Google + にログインしようとしています。私はこのコードを書きました:
NSURL *url = [NSURL URLWithString:@"https://accounts.google.com/"];
AFOAuth2Client *oauthClient = [AFOAuth2Client clientWithBaseURL:url clientID:@"MY_ID" secret:@"MY_SECRET"];
[oauthClient authenticateUsingOAuthWithPath:@"/o/oauth2/token"
parameters:@{@"scope": @"https://www.googleapis.com/auth/plus.me", @"response_type" : @"code", @"redirect_uri" : @"https://www.domain.com/oauth2callback"}
success:^(AFOAuthCredential *credential) {
NSLog(@"I have a token! %@", credential.accessToken);
} failure:^(NSError *error) {
NSLog(@"Error: %@", error);
}];
しかし、エラー ブロックは、invalid_request (エラー 400) で呼び出されます。何か不足していますか?(パラメーターがありませんか?)