Skip to content

Request is missing required authentication credential #40

Description

@RafaelEdKepler

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions