Added Google OAuth2 authentication feature using the access_token or id_token.
Type of change
[x] Added a new endpoint for authenticating using Google (api_token or access_token). New endpoint is: /wp-json/jwt-auth/v1/google_auth.
[x] The new endpoint receives two parameters (type and token). Where type can be either access_token or id_token, and token is the response received from Google OAuth2.
[x] Updated code for a more efficient way to access user information before sending data as API response.
Description
Added Google OAuth2 authentication feature using the
access_token
orid_token
.Type of change
api_token
oraccess_token
). New endpoint is:/wp-json/jwt-auth/v1/google_auth
.type
andtoken
). Wheretype
can be eitheraccess_token
orid_token
, andtoken
is the response received from Google OAuth2.$user->data->ID
,$user->data->user_email
,$user->data->user_nicename
,$user->data->display_name
to$user->ID
,$user->user_email
,$user->user_nicename
,$user->display_name
.How has this been tested?
access_token
andid_token
./wp-json/jwt-auth/v1/token/validate
and it works fine.Test Configuration:
Checklist: