laravel 5.5 login via google gives Client error - laravel

I was trying to add the google login to my laravel project. but it gives a Client error. Given below is the error i got. I successfully installed the socialite as well.
Client error: `GET https://www.googleapis.com/plus/v1/people/me?prettyPrint=false` resulted in a `403 Forbidden` response: {"error":{"errors":[{"domain":"usageLimits","reason":"accessNotConfigured","message":"Project 983930379932 is not found (truncated...)

Go to https://console.cloud.google.com/apis and enable Google+ api.
Took me 3 hours to find out that Google Cloud does not automatically enable the api for you when you create OAuth service.

Remember you have to register your google app within googles service as well. That error if I remember correctly is simply telling you that you aren't allowed to use google services.
I am not super sure if this steps are up to date, but it shouldn't be that different: https://itsolutionstuff.com/post/laravel-5-google-oauth-authentication-using-socialite-packageexample.html

First Open your Google Console Account from Here : console.developers.google.com
Select your project.
After this you have to click on google+ API detail page.
Now we can enable API.

Related

Google Cloud Run Hosted User Sign-In 'Redirect' Throws Error When Using External Identity Providers

I have a Google Cloud App Engine app that functions correctly when either I allow unauthenticated AllUsers access or turn on IAM for controlling access in Identity Aware Proxy. However when I follow the instructions on this page https://cloud.google.com/iap/docs/cloud-run-sign-in to enable Cloud Run Hosted sign-in with external identities and attempt to access either the login page or the Google Cloud Run hosted sign-in page, I receive the following error in the browser.
"Could not fetch URI /computeMetadata/v1/instance/service-accounts/default/token?scopes=https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/identitytoolkit"
For context, the Google Cloud Run service hosting the user sign-in is set to allow all Unauthenticated. It should re-direct to the Google App Engine web app. I think this is related to permissions or redirects, but I am at a loss as to how to fix. Any thoughts? Thanks!
I attempted to fix by re-deploying the Cloud Run Service, switching IAP on and off, switching between IAM and external identities, but to no success.
Thanks #John Hanley, I discovered that one my compute engine service account was disabled for some reason within the project. Re-enabling solved the problem partially. I'll spend more time matrix out the permissions and re-directs to make sure they are aligned.
I originally thought I completely answered my own question and solved my problem. Unfortunately, I only solved one of the problems with my implementation of the external identities authentication method.
Description of the other problem:
I enabled email/password and Google as providers, but when I click on the the option to authenticate with Google, I receive the following text in the browser: "The requested action is invalid."
At the Console in Dev Tools I get the following error:
GET https://www.googleapis.com/identitytoolkit/v3/relyingparty/getProjectConfig?key=*mykey*&cb=1599165379363 403
The following url is displayed in the URL bar:
https://.firebaseapp.com/__/auth/handler?apiKey=mykey&appName=%5BDEFAULT%5D-firebaseui-temp&authType=signInViaRedirect&providerId=google.com&customParameters=%7B%22hl%22%3A%22en%22%7D&scopes=profile&redirectUrl=https%3A%2F%2Fiap-gcip-hosted-ui-app-engine-app-myserver-uc.a.run.app%2F%3FapiKey%3Dmykey**&v=7.16.0&fw=FirebaseUI-web
mykey and myserver were removed for this post and is not the actual values.
Email/password sign-in works, but not the Google sign-in. What am I missing here?

Google console trouble with outh

I have a google application. Right now all my auth in nodejs working well. But when I'm trying to login using google I have an error that "Sign in with Google temporarily disabled for this app"
I've tried to find where I can enable auth, but no solution.
I think that it is a problem with google console settings.
How should it work? - I need to log in with my google account
Have you checked if the google+ API is enabled?

Impersonated User unauthorized in Google Analytics API, using Service Account

I'm using the Google's PHP API Client, release 1.1.6.
We have a company Google account which controls our many Google Analytics account as well as our Google Developer apps.
I'm working on an app accessing our Google Analytics, using a Service Account set-up. I'm using the same code provided here:
https://developers.google.com/api-client-library/php/auth/service-accounts#delegatingauthority
$credentials = new Google_Auth_AssertionCredentials(
$client_email,
$scopes,
$private_key,
'notasecret',
'http://oauth.net/grant_type/jwt/1.0/bearer',
$user_to_impersonate,
);
In this case $client_email is the App Service Account client (random-chars#developer.gserviceaccount.com) and $user_to_impersonate is our company's Google Account.
As of a couple days ago this was all working correctly, and I could access all our Google Analytics accounts through the API after the above authentication. As of yesterday, I'm getting this error:
Error refreshing the OAuth2 token, message: '{
"error" : "unauthorized_client",
"error_description" : "Unauthorized client or scope in request."
}'
With the $user_to_impersonate parameter removed the authenticated works without error. However, I've been using the $user_to_impersonate as we have several hundred GA accounts and the Service Account client is not a permitted user on them (and would have a limit of 200 accounts anyway).
I couldn't find any recent updates to the way Google Dev's authentication works, but maybe I'm missing something.
Any ideas?
UPDATE: Apparently this was a temporary error with Google's overall API, and is now fixed:
https://github.com/google/google-api-php-client/issues/891
UPDATE 2: Wasn't a temporary issues after all. The solution, if others need, is listed here. Basically giving your app perpetual access to the given account/scope.
https://github.com/google/google-api-php-client/issues/801#issuecomment-171417538
Google probably changed the handling of service accounts and this doesn't work anymore. It's not related to specific Google API client (PHP) nor specific API (Analytics), but it seems to me as a general change which affects everything.

Google Apps SAML error app_not_configured_for_user

I'm trying to enable SAML for our domain so that Google Apps is our idP
Unfortunately we're getting an error which we can't solve.
403. That’s an error.
Error: app_not_configured_for_user
Service is not configured for this user.
Request Details
SAMLRequest=jVNdj9owEHy/X4HyThICOQ6LpKKhH0gUIkjvoS+VsRfOUmK79obj/n2dhLujVRXVUpRovTM7O7uZW1qVmixqfJI7+FWDxbuBO5eqlJa0l4lXG0kUtcISSSuwBBnZL76tSeSHRBuFiqnS+wvWj6LWgkGhZAdbLRNvu/m03n5ZbX5ODnAccwgZi/kMgMMYJjNGD7MYxjHAQzSNxw98RDvoIxjreBLP0XaR3Kiz4GA2rmriFUo/Con0BNdS1tawkhapRAcKR/fDMBqGsyKcknhEoumPLm/pnBCSYsv9hKgtCQLKmKolWv+k1KkEn6kqUEHTbhQIrj+4R/AkC0fTUk/uqzc9rUMfheRCnvqNOXRJlnwtinyYb/dFR7J4NSxT0tYVmD2Ys2Dwfbfu5Dl1qHRFpevU+O7z3HXty/IqkDLrpS3ZvAmQ1gmT/h+4AqScIp0Ht9h3Nk0au1fLXJWCvbTx5nxWpqLY33ITEXx4bFOJbuZpESR6byyLslTPmQGKbqBoavAGwR+1r5sLvN1jZxHCBQeZqjQ1wjYThAtleG3/3YLb9Kx0S7mDY9q7t4ywJs+Fc/d6VoY34wXmaheGSquVwatH/yTvVAc9stO71+vbnzL9DQ==
RelayState=/
hl=nl
idpid=C017lp46m
That’s all we know.
We're building on Laravel 5.2 + the aacotroneo/laravel-saml2 package.
Is anybody familiar with this error?
Just to be sure, SAML is enabled for this user in Google Apps.
I had this problem and it turns out that I had two google apps for work accounts and I had configured the app in the wrong one. As a result, I got this message. Hope this helps.

google adwords api with google-adwords-api gem

I am trying to access google adwords api with 'google-adwords-api' ruby gem.
I have configured as per required. I have also set an test mcc account and api application. But still I am not able to access the api. It is giving following error
QuotaCheckError.ACCOUNT_INACTIVE
Also I am trying to set the environment to sandbox which gives following error
Environment 'SANDBOX' does not support version 'v201306' (AdsCommon::Errors::Error)
In documentationn it is mentioned that we can access api with test account even before approval.
Thanks in advance
I got fixed this.
The developer token needed for accessing the ad-words api should be created from production account and not from test account.

Resources