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
PlatformException(CANCELED, User canceled login, null) on Android #48
Comments
I'm experiencing the same issue |
@bl4ckbon3 I was actually able to fix the issue by importing the project into my own application. (Using the same code as above) It would not work in the GitHub project example that is provided in this repo.(I was using the example one and modifying it just to test the library before writing it into my application.) |
@jerejacobson Could you please explain a bit more how you got rid of this issue? |
@Guillaume-Vacelet Unfortunately I tried many things so I am not positive which one worked correctly. Besides that, I implemented the plugin like the example below. (Not Identical to the project's example) This is a function to launch the plugin and get the callback scheme and return the result. (The result is parsed for a salesforce keyword in my example )
And when I call this function I make sure to use await so my application doesn't continue without the function finishing.
And finally in my android > app > src > main > AndroidManifest.xml
I hope this info helps you to figure out your issue! |
I had this same issue and it turns out the problem was that I had two intent-filter entries with the same scheme. The other one was for my MainActivity. After removing that entry from my Manifest.xml it seems to work now. |
same issue here 😢 |
same issue |
In my case, it happens when launched other app. I resolved this by using
To be honest, I don't understand why this code in would correct the behavior. I hope this is helpful to someone else. |
Had the same issue.
|
I already had the activity setup as both the README and @pinguluk describe, but I was still having this issue. My problem was that I stupidly tried using a mixed-case URL scheme. When the redirect happened, the provider (rightly) lowercased the scheme, but the CallbackActivity looks for the expected callback as a (case-sensitive, obviously) string key in a map. Since it can't find the callback, nothing happens. Later the cleanup method runs and throws this exception. Making sure I used a fully lowercase callback scheme solved everything. |
I have the same issue and I tried all the proposed workarounds, I assume in my case it happened after I set the target version of the project to 31. could it be that? |
in my case I had to set
|
This is gonna sound dumb but: for the callback schema within the .dart file, don't have a |
The callback scheme will be validated in the next version: 4f89925 We've also added a troubleshooting section: |
Does anyone solved it? iam still having problems |
Yes, same problem continues while accessing to Spotify Web API. I'm authenticating with browser but it's coming null instead of new callback url. |
I solved it and I'm happier then ever. In my case I forgot the change urlschme after url parameter in the FlutterWebAuth2.authenticate method. |
Hi, This is my first time using Oauth2 and I am trying to get my callback from the salesforce rest API.
I can launch the authenticate() and login to salesforce. Salesforce then re-routes to my call back "myappname://callback?code=aWekysIEeq.....etc", but it throws a PlatformException(CANCELED, User canceled login, null) on android. I check out issue #45 but I am already calling things the right way as far as I can tell. (I might be overlooking the obvious)
I have included the image of the code I am using. (censored both my client_id and redirect_uri "myappname")
Also, I have my android manifest "intent-filter" inside my main activity.
If anyone has any ideas or knows of anything I can try I would greatly appreciate it.
thanks!
The text was updated successfully, but these errors were encountered: