maxep / DiscogsAPI

An Objective-C interface for Discogs API v2.0
MIT License
19 stars 11 forks source link

Authentication in auth view doesn't work with google login #20

Open nrivard opened 6 years ago

nrivard commented 6 years ago

My app was rejected by Apple because Google requires their login flow to occur in a system browser, not as part of a webview in a 3rd party app. Not sure what the best solution is here. Perhaps best to explore use of SFAuthenticationSession here, so SFSafariViewController will get automatically launched instead? Otherwise, everyone will have to kick out to regular Safari using the custom callback scheme.

nrivard commented 6 years ago

Looked into a bit and we can't use SFAuthenticationSession or SFSafariViewController bc Discogs uses OAuth 1. OAuth 1 needs headers in the HTTP request to be filled out but there is no URLRequest use with either of those two classes, just a URL.

maxep commented 6 years ago

Thanks for the report, I will update the readme then.

nrivard commented 6 years ago

My fork is a bit too out of step with master (or I'd submit a PR) but you can see my solution here: https://github.com/nrivard/DiscogsAPI/commit/e5c328b937e48c1d9d204c70463139f6a5e65e68

When I get time I will try to resolve my fork with your work but if you want to cherry-pick this I wouldn't mind. Tested against ios 10 and 11 in various scenarios.