NordicSemiconductor / Android-nRF-Beacon-for-Eddystone

An application with Eddystone GATT Configuration Service & Google Nearby API and Proximity API.
BSD 3-Clause "New" or "Revised" License
48 stars 18 forks source link

Problem to sign in with my account google to list google projects #7

Closed UlyssesGomes closed 7 years ago

UlyssesGomes commented 7 years ago

Hi,

I am not able to log in with my google account. No error is triggered when I try to log in and the following message is shown in the application "Please sign in with your google account to register / select projects for beacon registration.". But the account I used has the project with the credentials set up and added the API's to the beacon proximity, nearby messages and URL shortener. I put the api key into the Utils class and into android.manifest too. Following is the screen shot of the error and the message displayed in the application.

screenshot_2017-06-05-14-29-31_br edu ufcg virtus honeywell eddystone

Note: permissions for the BeaconEditor, AttachmentEditor, and AttachmentPublisher were also given.

roshanrajaratnam commented 7 years ago

Hi have you been able to sign in on the app with the Google account set up on your phone? Did you get to select the Google account and grant permissions?

UlyssesGomes commented 7 years ago

I used the email from the phone and allowed all the permissions that the application requested. Is it necessary to allow some other permission that is not explicit in the repository description?

roshanrajaratnam commented 7 years ago

Right. Have you also added the client secret as mentioned in the description. There is nothing specific that is not mentioned in the repo

UlyssesGomes commented 7 years ago

What is the "client secret" and where i add him?

laccf commented 7 years ago

@roshanrajaratnam , it's weard, beacause google says that client_secret is no longer necessary: https://developers.google.com/drive/android/auth

so, how could we fix this using client_secret? could you help us?

roshanrajaratnam commented 7 years ago

I think you're looking at the wrong documentation as to what's pointed out in the repository. https://developers.google.com/identity/sign-in/android/start-integrating

laccf commented 7 years ago

@roshanrajaratnam , you right, i'm sorry. following this doc, I got another issue. The app cannot show my projects:

photo_2017-06-08_10-09-16

I've tried too many possibilities to set the values of this variables:

untitled

At first, when the app is running, the code does not set the correct values (it always sets empsty value):

image

But when I force the value, like this: image

I always got the error, that means I'm using the wrong token: Response{protocol=h2, code=401, message=, url=https://cloudresourcemanager.googleapis.com/v1beta1/projects}

Do you know where do I get the Token that I should use here?

roshanrajaratnam commented 7 years ago

No problem, happy to help.

With your second issue, the token is something you receive when you Sign in with your Google account. So if you look at the GoogleSignInDialogFragment you can see the token is saved in the shared preferences. This token is used through out the app to make the calls to project selection etc, so I suggest having a look there if you receive your token in the first place.

laccf commented 7 years ago

Thanks again, @roshanrajaratnam . The code never runs the methods saveAccessToken and saveNewAccessToken from GoogleSignInDialogFragment . I tried to debug this before, and the deal is that it never runs. So, if it never runs, probably there is a issue that happens before that. I'll look up that.

laccf commented 7 years ago

@roshanrajaratnam , what about this .add("client_secret", "ADD_YOUR_CLIENT_SECRET") that are in RefreshAccessTokenTask.java and RequestAccessTokenTask.java, do you know something about that?

roshanrajaratnam commented 7 years ago

This is the client secret I was referring to before. I think it's my bad that it's not mentioned in here in the documentation properly. This is th client secret you get when you create your oauth 2.0 client ID in your Google console project.

laccf commented 7 years ago

@roshanrajaratnam , thank you so much. we made it. I got the client secret from the client that i've been using the Id and it works properly.

roshanrajaratnam commented 7 years ago

That's great to here. I will close the issue if everything is working for you.

UlyssesGomes commented 7 years ago

It is everything ok now. Thank you for you help @roshanrajaratnam. :)