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
A task was cancelled #41
Comments
Is this on device or on an emulator? iOS or Android? Also, what api are you using? the standard Google Api, or did you activate the native google auth? |
Android. This issue reproduces on devices and emulator. I use standard Google Api.
When i am trying to login, app always throws TaskCanceledException. |
I have tried multiple times, on both Sample.Droid, and Sample.Forms.Droid. I cannot reproduce this. Can you try debugging and see where the task canceled came from? |
@Fr2eman I just installed the SimpleAuth tonight and am testing the Google auth and am getting this exact same issue. Did either of you figure this out? I'm debugging on a physical device.
My app crashes and stack trace leads to:
|
I am unable to duplicate this, would you mind debugging the sample and let me know what is calling canceled? I can help fix it if I can duplicate it. I do accept pull requests! Also you should always |
So I am using The exception is being thrown from the I tried a |
Sorry for debugging info, would you mind cloning the repo and running one of the Android samples? See if you can still duplicate it. They reference the source. Also on the next version I will start shipping debug symbols. That has been on my todo list for awhile. |
Will try that now. |
In my own app, I hit login as google, it shows me the prompt to select a Google account. I tap the account I want to login as. Then the app crashes. However, in your sample project |
:( That's the problem I have been having. I cannot duplicate it. You could try changing the secrets in the sample, and the signing so it matches. Maybe it is a config issue? Or you can try referencing SimpleAuth from source in your app? That may lead to the exception. |
I can try swapping the client Id/Secret... but can you tell me what |
There isn't one. So here is how that works. Google doesn't require the secret unless you are going to refresh the tokens yourself. (It actually works better if you pass the secret). If you don't pass in a secret, Simple Auth handles it just fine. That variable is a temp value used to determine if you are not using a secret. |
Ok swapping your clientId/secret with mine gives me a "user cancelled" alert. It appears I don't have something right with my creds. Thoughts? |
That could be. Getting that stuff right can be a pain. How did you generate your secret? I have a section in the readme on it. |
Honestly, I read that like 3 times and I'm sorely confused at what to make. I already had a Web Application credential so I didn't make a new one. I made a new "App" credential and pulled the SHA1 signature from my signing key and put it in the there... don't know what I'm doing wrong ... or what I'm doing at all :) |
Which clientId goes into the SimpleAuth ??? the Web Application one or the App one? |
Let me find the screenshot of the samples. Trying to remember |
Pass in the Web ClientID/Secret. The rest should auto work from the signing keys. |
Also they need to be in the same project. The Android and WebAPI should both be listed on the same tab here. |
That is what I have, but I don't think I got the right signing key... what is the keystore for debug mode? I used my production keystore and I dont' think that works. Super confused here, but thanks for helping me troubleshoot this. As you can see, I had the web application one created last year, and I just created the "Android" one today. |
So the key signing has to be right. When you created the android app, it asks for the fingerprint. For debugging you can find information about the default keys here You can change the debug key and use your production key there. |
Also the default Xamarin Debug keys are different on every machine. So use your keys signing stuff. |
You will notice, I include the keystore to ensure it works for everyone testing. CSProj using it for signing |
Ok so does this mean I need to build my app with the same keystore when debugging and for production? Can I have two "app" in the google credentials store (one for dev and one for prod)? |
Looks like that last piece of advice helped. I swapped out my debug configuration in my CSProj to use the product keystore file in the build... restarted the app and it worked! Thanks a lot! |
I would sign both Debug and Production the same. As I said, default debug keys change per machine. Which would make things confusing as you switch dev machines and build servers. |
Great point, I'll follow this approach. One last thing. I'm not getting any UserData back in the account object. What would cause this? |
Using the native login the data you get back is limited. However there is a convenience method: https://github.com/Clancey/SimpleAuth/blob/master/src/SimpleAuth/Providers/Google.cs#L123-L134 |
Perfect |
Huge help today! Much thanks my friend. |
It's also nice to know that if there is no internet connection and the user has never signed in into the app, when the user clicks sign in a pop up shows all the users account but when he/she clicks on one of them it results in a |
Hi there I am facing the same issue. Although it worked it suddenly started to throw this exception. |
I have a problem with login with google. Exception throws when i am trying to login
Exception: "A task was cancelled" after i try call
I have tried to check example. But It throws the same exception.
The text was updated successfully, but these errors were encountered: