PHP error with oauth2

Thanks but still getting the exact same error message. Excerpt:

/dmxConnectLib/lib/oauth/Oauth2.php",“line”:167,“message”:“Undefined index: jwt”,“trace”:"#0

I remain confused abt this jwt matter as I’ve followed the google and facebook oauth2 connect tutorials and none mentions a jwt setup. Why is there a jwt_bearer?

The jwt_bearer is required for google service accounts.

Here a small update where I have added some extra checks to prevent php errors.

Oauth2.zip (3.3 KB) Unzip to dmxConnectLib/lib/oauth.

Good to know. So what would the jwt setup be there?

Will install the file and report, thanks.

GET error 500:

So I’ll await your update guys on the right jwt setup. Thanks.

The jwt is only needed for google service accounts, depending on which api you try to access you will need it or not.

With the new php it should prevent that error, are you sure you’ve uploaded it to the server?

Yes I did upload the new oauth2.php file to the server.
I’m trying to setup a oauth login with google account. Shall I use these jwt settings:

You have to check with the google documentation which credentials you require for the specific API you are using. Some APIs require it and some not. When you want to access some personal data like from google drive or gmail then you don’t use the service account but the personal account which doesn’t require the jwt.

That part of google docs is a maze, I’ll have to give up alas, unless @mebeingken has a video that we can access (and pay for it) even if slightly out dated, at least I’ll get an idea of the flow of steps for a google sign-in.

I was told by a google oauth expert that when user is prompted for an access approval by us, there is no need for service account. So I’ve removed jwt signing in the globals.
And I’ve set this in the oauth2 provider file: "jwt_bearer": "false",
image

Now I get 500 error: "message":"Undefined index: false", from line 167 of your oauth2.php file.
image
Does it require a fix or a different setup?

Remove the option completely, setting it to "false" it sees it as being set.

Thank you!! I have my google prompt now. You can fix your wappler files.

EDIT: I will try to find and share the right, up-to-date Google oauth2 API url, current one shared in tutorial does not return first and last names.

1 Like

Can you please share an updated Google Authentication for wappler please.
I still can’t make mine to work based on the forum tutorial.

Ok, sharing the main steps, assuming you’ve done the Google Cloud setup already.

In the Globals, have the jwt setup, after you do the right setup on your Google Cloud Services:

Value in the Claims section:
https://www.googleapis.com/oauth2/v2/userinfo
image

In the oauth of Globals:

Create an API action with the following flow (it’s based on an existing forum tutorial):

URL: https://people.googleapis.com/v1/people/me

Hope this helps.

Hi, thanks for the details but where can I find the “Issuer”, “audience” and “Key” for the JWT inputs.

1 Like

My bad, sorry, have done this setup months ago and don’t remember all the details, you don’t need JWT, only oauth:
image

Hi, so should I follow only from the OAuth2 step !?
I am trying to create a log in using google and can’t find a way for months now :frowning: followed all forum tutorials on the subject and can’t find a clean straight fwrd follow through tutorial that works.
Any help would be very appreciated.

Yes.

I’ve followed this tutorial


…and made some fixes (as per my sharing above)

I followed that one and it gives me this error :

Are you using a custom db query in your server action?