0
23과 나와 데이터를 얻기 위해 oauth2를 사용하려고하지만 "잘못된 요청"코드가 계속 나타납니다. OAuth2로 작업 한 것은 이번이 처음이며, 무엇이 잘못되었는지 잘 모르겠습니다. 내가 AFOAuth2Client를 사용하는 경우iPhone에 23andMe oauth2 예제가 있습니까?
, 내가 얻을 오류 코드 400 :
오류 블록이 메시지와 타격AFOAuth2Client* oauthClient = [AFOAuth2Client clientWithBaseURL:[NSURL URLWithString:@"https://api.23andme.com/"] clientID:clientIDString secret:secretString];
[oauthClient authenticateUsingOAuthWithPath:@"/token/"
code:@"zzz"
redirectURI:@"myapp://callback/oauth"
scope:@"analyses"
success:^(AFOAuthCredential *credential)
{
NSLog(@"I have a token! %@", credential.accessToken);
[AFOAuthCredential storeCredential:credential withIdentifier:oauthClient.serviceProviderIdentifier];
}
failure:^(NSError *error) {
NSLog(@"Error: %@", error);
}];
: 나는 GTMOauth2Sample을하려고하면
Error: Error Domain=com.alamofire.networking.error Code=-1011 "Expected status code in (200-299), got 400" UserInfo=0x1fda4f80 {NSErrorFailingURLKey=https://api.23andme.com/token/, NSLocalizedDescription=Expected status code in (200-299), got 400}
, 내가 승인 후 invalid_client 오류 화면을 닫습니다.
내가 뭘 잘못하고 있니?