Google Sign on with API

Hi, I have been successfully implemented JWT authentication with the PHPM19 api from a mobile web app to access my data. But have the following issues:

  1. How can I register a new user (when user does not exist) via the API?
  2. Is possible to add login using Google sign-in within the API, how does this works with JWT and receive the token.?

thanks

  1. You may use the “add” action of the user table.
  2. That is different from JWT, you need to implement it yourself, read: https://developers.google.com/identity/sign-in/web/sign-in.

Thank you, I still not clear

so is there a way to login or register through API directly with Google sign in?And maybe use the uniqueID. Google provides as back end phpmaker password to authenticate on API ?Is this a good approach?

The API only knows JWT, after logging in from Google, your code should login by JWT for the user.

Hi, thank you for your answer, right I know that but after I authenticate with Google, what is the workflow to authenticate with the API and get the JWT token if the I will not send the password for login ?

If you can clearify a bit or maybe point me to a proper guide will be greatly appreciated…thanks

Refer to the source code of function login() in api.php on how to create the JWT token.

Thank you, will check on it.