electron-oauth-helper icon indicating copy to clipboard operation
electron-oauth-helper copied to clipboard

Uncaught Error: client_id is required for code

Open RossComputerGuy opened this issue 7 years ago • 8 comments

I'm using Firebase and I'm getting this error. How do I fix it?

RossComputerGuy avatar Oct 31 '18 21:10 RossComputerGuy

Thanks to your question!

client_id is required parameter. Did you configure this?

https://github.com/mironal/electron-oauth-helper/blob/master/example/src/main/config.example.js may help to you.

mironal avatar Nov 01 '18 23:11 mironal

I configured it like the example shows by just pasting in the firebase config.--Sent from Yandex.Mail for mobile01.11.2018, 16:09, "mironal" [email protected]:Thanks to your question! client_id is required parameter. Did you configure this? https://github.com/mironal/electron-oauth-helper/blob/master/example/src/main/config.example.js may help to you.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.

RossComputerGuy avatar Nov 02 '18 13:11 RossComputerGuy

Which OAuth Provider are you using?

mironal avatar Nov 03 '18 13:11 mironal

The second one

RossComputerGuy avatar Nov 03 '18 15:11 RossComputerGuy

Do you set response_type parameter ?

and, Is there a similar error even if I run it in the example program? (Do not forget to rename config.example.js to config.js)

mironal avatar Nov 04 '18 05:11 mironal

No and there is a similar error in the example.

RossComputerGuy avatar Nov 04 '18 05:11 RossComputerGuy

Hmm. I tried Google's OAuth2 using example code, but no error client_id is required for code occurred.

You need to set "response_type" like the following code.

const GoogleClientWebApp = {
  client_id: "your client id", // <- rewrite your client id
  client_secret: "your client secret", // <- rewrite your client secret
  redirect_uri: "your redirect uri", // <- rewrite your redirect uri
  authorize_url: "https://accounts.google.com/o/oauth2/v2/auth",
  response_type: "token", // <- Do not forget this.
  scope: "https://www.googleapis.com/auth/userinfo.profile",
}

mironal avatar Nov 04 '18 06:11 mironal

I’m not using GoogleClientWebApp because I saw it not being used with firebase in config.example.js.

RossComputerGuy avatar Nov 04 '18 12:11 RossComputerGuy