where to find authentication code in gcloud? - gcloud

when gsutil config is executed , i would need to enter in the authetication code.
Where extacly I can find a authentication code.

Follow the URL provided in the message you receive (under 'Please navigate your browser to the following URL').
It should lead you to the code which you need to use for the authentication.

Related

When I log in to the Cloud foundry (Authenticating... {"error":"invalid_grant","error_description":"User authentication failed: unauthorized"})

I am inside the SAP Business Application Studio, inside the terminal, when I put the CF login command I enter my credentials and this appears
Authenticating...
{"error":"invalid_grant","error_description":"User authentication failed: Unauthorized"}
Could you please help me
The solution on my side is to use the --sso option.
cf login --sso -a https://api.cf.us10.hana.ondemand.com
Afterwards you will be prompted to get a passcode from this url: https://login.cf.us10.hana.ondemand.com/passcode
However, for me this failed several times.
The key is to use alternative identity provider on the login screen
and enter sap.ids as provider when you already have an SAP Universal login
Sadly, this does not work when using trial version in API endpoint https://api.cf.us10-001.hana.ondemand.com . I already opened a support request.

Google Auth API - idpiframe_initialization_failed on Production environment

I integrate Google's Auth API in my production website.
When I enter the login page, it throws an idpiframe_initialization_failed exceptions to the console.
I found out that I can fix it by enabling that API / Cookies in my chrome browser, but I want to find a comprehensive solution that will prevent those exceptions in my production environment.
So my two questions are:
What do you suggest me to do in order to achieve that?
In general, what is the meaning of those excpections?
Thanks :)
If you have a production url like http://godaddysite.com etc host your page there with a Webserver.
Opening a htnl page from your computer with javascript doesnot work as it is not hosted on webserver.
Please check your redirect url etc when you created Oauth client.
Go to the Credentials page.
Click Create credentials > OAuth client ID.
Select the Web application application type.
Name your OAuth 2.0 client and click Create
check origins
create new OAuth with correct origins.

How do I sign in to GitHub from command line after password access is removed?

GitHub is retiring password based authentication for command line tools: https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/
Normally I work in some server, git clone https://...., enter my username and password and get the code that I have to deploy.
What am I supposed to do now? Do I create a token, write it down on a piece of paper, take it with me and retype it into a terminal? Seems a bit too convoluted for just getting some code. Is there some other "intended" workflow?
There are a few options:
You can create a personal access token in your github settings and use that instead of your account password.
you can use SSH to connect
you can rely on the Git Credential Manager Core which will perform an OAuth check either by popping up a UI or giving you an url to paste into a browser.
some hardware tokens will enable you to perform authentication.

Stitch Facebook authentication returns "AuthError"

Using the Stitch Facebook authentication provider with the Web/JS SDK the auth flow seems to work fine up until the redirect is done back to the Stitch servers.
loginFB() {
const credentialFB = new FacebookRedirectCredential();
this.$stitch.auth.loginWithRedirect(credentialFB);
}
It then returns this error from the Stitch service:
https://eu-west-1.aws.stitch.mongodb.com/api/client/v2.0/auth/callback?code=AQClGc41QMShUyLT0FOIyGM4ZEi8FPEj4qSHF022F6gGqdIYrgBmop7QVWVuKQYH-CNCtGNSpOWJSVu9_nZwrHauMVrKt6CeswVIgRs5iQpt84YPFkg35BXZHf_PGcpvTsTBt2HC4B_yyYCcYCc4Ccn_wlCkG9bu-LwfKOePDtTYOJahys-xflBC8IyveMZIAK9lc00orXqC7zooETDgrE8KdoDw6uE8Q8zT_XMD7fGmCB7_-kcnmE9wScgC2Vsb38_AG4dkazNG_IenKpbo0s7vfDDfRLPawXpeWpSue_PRYLGSoKUB1UyWSNiujuq3ClE&state=nBspwBNKIdbEUxcyFdrHDudGKbuJhfjVTcHpzyMjSi-uImn5LQG3XtsgqRUGsB_UIEVnAIi6dswt5FwV90kphQ%3D%3D#=
error: "error exchanging access code with OAuth2 provider"
error_code: "AuthError"
link: "https://stitch.mongodb.com/groups/5ded6422f2a30b6096c347b8/apps/5dfdd120fab085de276dacb2/logs?co_id=5e176295f9d51cd518d60dc6"
Following the link in the error message we arrive at the Stitch logs which says the same thing.
I have followed the official docs (Google Auth works wonders, no worries there) for setting it up and tested the following:
Modified Redirect URIs, tested on hosted (https / http) and localhost.
Configured a Test App in Facebook dev
Tested the various settings for the auth in Facebook console.
Enable forced Re-auth in Facebook, I must then provide password and once that completes same error.
Trying to find information on this error in the official docs or here on Stackoverflow has yielded no results unfortunately. Could someone help explain how to get around this error?
Docs:
https://docs.mongodb.com/stitch/authentication/facebook/
https://docs.mongodb.com/stitch/tutorials/guides/todo-guide-facebook/
The error shown was due to a faulty app secret in the Auth provider section in Stitch. Once that was mended to a correct secret from the Facebook App the login worked as intended. This error should be mentioned somewhere in stitch docs but does not to be documented there at the time of writing this.

How can I use gcloud auth?

I am trying to follow the tutorial of python with google cloud sql.
When I run: ./cloud_sql_proxy -instances="My-connection-name"=tcp:3306, I get google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information..
Also, when I run: gcloud auth application-default login, I get www.googleapis.com%2Fauth%2Fcloud-platform&access_type=offline" doesn’t understand the “open location” message. (-1708)
I followed downloaded the json file for the credintials and set the enviromnet virable GOOGLE_APPLICATION_CREDENTIALS to link to the json file, but I still get the same error.
TL;DR - You can ignore the doesn’t understand the “open location” message. (-1708) error. You should see a browser window/tab opening with the URL, if not you can follow the steps I've added below where you can manually copy-paste the URL in the browser and you should not be seeing any warnings/errors.
You will need to authorize gcloud (one-time step) to use your account credentials for Google Cloud API calls.
Run gcloud auth application-default login --no-launch-browser
You will be provided a URL. Open the URL in the browser, authorize the application using your Google account and you will be provided a verification code in the page.
Copy the verification code and paste it back in the terminal where you ran the gcloud command in Step 1.
Now gcloud as well as any Google Cloud Client libraries you use can make use of the Application Default Credentials from that machine.