J'essaie de faire fonctionner OAuth2 de Google pour la vérification des utilisateurs dans une application iOS. J'utilise l'API OAuth2Client mais je n'arrive pas à l'utiliser avec google. Il semble que google n'accepte que http: // localhost ou urn: ietf: wg: oauth: 2.0: oob comme URL de redirection. M'empêcher d'utiliser un schéma personnalisé pour déclencher un retour à mon application.iOS: OAuth2Client et Google
Le code ressemble à ceci:
[[NXOAuth2AccountStore sharedStore] setClientID:@"<client-id>"
secret:@"<secret>"
authorizationURL:[NSURL URLWithString:@"https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile"]
tokenURL:[NSURL URLWithString:@""]
redirectURL:[NSURL URLWithString:@"http://localhost"]
forAccountType:@"Google"];
[[NXOAuth2AccountStore sharedStore] requestAccessToAccountWithType:@"Google"];
Quand je lance, Safari apparaît et demande un accès, mais est bloqué parce que je ne peux pas rediriger vers l'application.
Quelqu'un sait comment faire fonctionner ce travail ou ai-je besoin d'une API différente? Remarque: je ne peux pas accéder actuellement à Google Toolbox OAuth2 kit ATM.