Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request is missing required authentication credential #40

Open
RafaelEdKepler opened this issue May 18, 2021 · 0 comments
Open

Request is missing required authentication credential #40

RafaelEdKepler opened this issue May 18, 2021 · 0 comments

Comments

@RafaelEdKepler
Copy link

RafaelEdKepler commented May 18, 2021

I am using this api to store new contacts in every new register in my application

So, using laravel, I created a Job to do this for me:

$googleOAuth2Handler = new GoogleOAuth2Handler($clientId, $clientSecret, $scopes, $refreshToken);

$people = new GooglePeople($googleOAuth2Handler);

$name = explode(' ', $this->data['name']);

$contact = new Contact($people);
$contact->names[0] = new \stdClass();
$contact->names[0]->givenName = $name[0];
$contact->names[0]->familyName = count($name) > 1 ? $name[1] : ' ';
$contact->phoneNumbers[0] = new \stdClass();
$contact->phoneNumbers[0]->value = $this->data['entity_phone'];
$contact->save();

This was working until last month, but now I am receiving this error every single time I try to register a new contact:

"error": {
    "code": 401,
    "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
    "status": "UNAUTHENTICATED"
  }

I already tried create a new refresh token, but still got the same error message. Someone know what can I do to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant