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

App seems to not getUserProfile #3

Closed
samgithub-duplicate opened this issue Jul 27, 2018 · 9 comments
Closed

App seems to not getUserProfile #3

samgithub-duplicate opened this issue Jul 27, 2018 · 9 comments

Comments

@samgithub-duplicate
Copy link

I am following the examle in "simple_auth_flutter_example"

When I get to

var user = await googleApi.getUserProfile();
The app shows the Google Sign-in page.
After 'signing' in nothing seems to happen. I have a breakpoint after the getUserProfile. It does not get hit.

Sam

@Clancey
Copy link
Owner

Clancey commented Jul 27, 2018

on iOS or Android? Did you follow the Callback parts from the readme in iOS and Android?

@samgithub-duplicate
Copy link
Author

samgithub-duplicate commented Jul 27, 2018 via email

@samgithub-duplicate
Copy link
Author

I have double-checked and set everything up meticulously. What I notice is that if I use your sample (in https://github.com/Clancey/simple_auth/blob/master/simple_auth_flutter_example/lib/main.dart)

i.e (using the credentials in the sample link above: (blocked off in asterisks below. I get the sign in page BUT after signing-in, I get an error "invalid credentials". If I use MY app credentials I do NOT get the sign-in page, but I get an error "Custom Schemes are not allowed for Web Client Type"


final simpleAuth.GoogleApi googleApi = new simpleAuth.GoogleApi("google",
"992461286651-k3tsbcreniknqptanrugsetiimt0lkvo.apps.googleusercontent.com",
clientSecret: "avrYAIxweNZwcHpsBlIzTp04",
scopes: [
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/userinfo.profile"
]);


Sam

@Clancey
Copy link
Owner

Clancey commented Jul 30, 2018

Try the sample again, I just found a small bug. Also your credentials are not the right king. You created Web credentials. You need to create some for iOS/Android.

@samgithub-duplicate
Copy link
Author

samgithub-duplicate commented Jul 31, 2018 via email

@Clancey
Copy link
Owner

Clancey commented Jul 31, 2018

Nope, it has a default of 'native' . https://github.com/Clancey/simple_auth/blob/master/simple_auth/lib/src/providers/google.dart#L10
This is how it works on Android/iOS without a secret.

@samgithub-duplicate
Copy link
Author

Thanks for the 1.0.1 update. In the meantime, I decided to check out your Facebook implementation. using simple_auth_flutter 1.0.1
After logging in, I get an error localhost refused to connect.

@Clancey
Copy link
Owner

Clancey commented Aug 2, 2018

You can't use local Host as a redirect unless you use the embedded browser. It is off by default. You need to use a redirect with a custom scheme for your app.

@samgithub-duplicate
Copy link
Author

James, please close this issue. I found a way to authenticate with Facebook. I'll be creating another issue for Microsoft Live Acounts

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