Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flickr doesn't recognise the "oauth_token" this application is trying to use #56

Open
edgar-zigis opened this issue Oct 2, 2017 · 1 comment

Comments

@edgar-zigis
Copy link

Hello,
I am trying to implement Flickr authorization, it seems that it succeeds to enter into project page, but after clicking at button which gives app permission - webview shows this message:

Flickr doesn't recognise the "oauth_token" this application is trying to use

I am using this code to authenticate:
let url = URL(string: "flickrapp://auth")
FlickrKit.shared().beginAuth(withCallbackURL: url!, permission: FKPermission.delete) { (url, error) in
Tools.runAsync {
if let error = error {
self.showError(error.localizedDescription)
} else {
print(url?.absoluteString)
let urlRequest = NSMutableURLRequest.init(url: url!, cachePolicy: NSURLRequest.CachePolicy.useProtocolCachePolicy, timeoutInterval: 30)
self.flickrWebView.isHidden = false
self.flickrWebView.loadRequest(urlRequest as URLRequest)
}
}
}

I print url in webview and it prints generated oauth_token, so token is generated. However it fails at flickr.

@devedup
Copy link
Owner

devedup commented Apr 20, 2020

Sorry for the very late reply... however for the next person who reads this....

Sounds like you've missed the step with the callback URL. After you log in via Flickr successfully in the web view, Flickr redirects to your custom URL scheme that you configured when you setup your Flickr API Key, in the Callback URL section.

Example:

myscheme://auth?

This needs to be in your Info.plist file under URL Types > URL Schemes

You then need to ensure your app handles this in

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url;
optional func application(_ application: UIApplication, handleOpen url: URL) -> Bool

You would then be calling this method on FlickrKit:

completeAuthWithURL

Something like that anyway... it's been a while since i worked on this... 😳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants