Open cheekuji opened 8 years ago
A few questions:
Best,
I am using latest version of ngcordova Yes I have, I can login via Android. All information is there.
Even with android I can see a page not found error for a split second and it goes away for ios I jiust cannot login at all.
From xcode logs I see this error: webView:didFailLoadWithError - -1004: Could not connect to the server.
I update the in app browser now I cannot login at all. I get this error: The sign in flow was canceled
Are you using ng-cordova or ng-cordova-oauth? They are not the same. My library, ng-cordova-oauth, has no affiliation with what Ionic has produced.
On iOS you need to enable ATS. Because LinkedIn uses explicit grants you will always see for a moment an error screen for both Android and iOS. Only way to prevent this is to host your own redirect url.
Got the same error "The sign in flow was canceled" since Angular 1.6.X. Works like a charm with Angular 1.5.11 and InAppBrowser 1.7.0
Is this still an issue?
Yes still
+1 facing the issue 'Sign in flow was cancelled'
@nraboy did some digging and found the problem on line 1173. At least for the linkedIn login.
`var browserRef = window.cordova.InAppBrowser.open('https://www.linkedin.com/uas/oauth2/authorization?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&scope=' + appScope.join(" ") + '&response_type=code&state=' + state, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes');
`
I removed theappScope.join()
bit and changed it to
` var browserRef = window.cordova.InAppBrowser.open('https://www.linkedin.com/uas/oauth2/authorization?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=code&state=' + state, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes');
`
Now it works fine. Returns a valid token, though there's brief & ugly error page that flickers just before it closes.
Does this have anything to do with the fact that you need URL encoded strings for the scope ?
It could be the reason.
You do need scope
otherwise you cannot define the permissions which will lead to other problems. Even though it worked for you, I'm sure you'll run into issues without the scope
.
In terms of the flicker, it is because it is an explicit grant which is two step (get code and request access token) rather than an implicit grant (request access token). It is a race condition. You can make it a little more attractive by overriding the localhost with a real website.
I'm open to pull requests if you think you have a fix to all this.
Fair enough. LinkedIn applies the default permission for apps when you don't specify them. That's worked for me so far.
Facebook fails for me anyway, since it expects that you make requests from explicitly whitelisted domains, as specified in advance in the developer dashboard. But my implementation is from client side mobile apps (hybrid), which have varying IPs. So I'm not sure how'd I'd go about it for now.
On 30 September 2017 at 01:52, Nic Raboy notifications@github.com wrote:
It could be the reason.
You do need scope otherwise you cannot define the permissions which will lead to other problems. Even though it worked for you, I'm sure you'll run into issues without the scope.
In terms of the flicker, it is because it is an explicit grant which is two step (get code and request access token) rather than an implicit grant (request access token). It is a race condition. You can make it a little more attractive by overriding the localhost with a real website.
I'm open to pull requests if you think you have a fix to all this.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nraboy/ng-cordova-oauth/issues/298#issuecomment-333229542, or mute the thread https://github.com/notifications/unsubscribe-auth/AOK1-KLQfJGNOawBHEakgLwZQYEKCt7zks5snVF3gaJpZM4KkNMU .
I was able to bring up the login page for linked in but when I hit cancel instead of submitting the credentials I get the following message: {"error_description":"missing required parameters, includes an invalid parameter value, parameter more than once. : Unable to retrieve access token : authorization code not found","error":"invalid_request"}
Another problem is I can only signin via android. Whenever I use iphone I ge the same message above: {"error_description":"missing required parameters, includes an invalid parameter value, parameter more than once. : Unable to retrieve access token : authorization code not found","error":"invalid_request"}