RuiFortes
RuiFortes

Reputation: 183

Can't make "Identity" sample app work with my own client_id

I'm trying to understand how to wrap up the process of developing a package app that has access to users google drive data. I started examining the "gdocs" sample but soon reverted to the "identity" because I just can't manage to make authorization mechanism work with my own client_id.

I'm currently using chrome canary and I can load the unpacked extension to chrome and make it work. (both identity and gdocs samples) I am trying to change the client_id in the manifest to my own client_id but I just can't figure out how to make it work. I always get a "bad client id" response. I could authorize web apps using "gapi.client.setApiKey(apiKey)" but not these packaged apps sample using "chrome.identity.getAuthToken" I tried all possible combinations but the correct one it seems.

What is the correct way to authorize a packaged app while in development stage? Do I need to upload it to Chrome Developer Dashboard first? Can someone help? Thanks.

Upvotes: 1

Views: 728

Answers (1)

fgorski
fgorski

Reputation: 231

Following the updated documentation for Identity API you will need to upload your application to the Developer Dashboard, in order to obtain the application key, and then copy it to manifest.json. That is how you ensure your extension ID is fixed.

Next in Google API Console you will select Installed application and Chrome application, specifying your extension ID (that is your application ID). That will generate a proper client ID that will be matching your application.

Please follow the first link for details.

Upvotes: 1

Related Questions