Gitlab login issue via Sourcetree - authentication

I'd like to reach my repositories from my own Gitlab account via Sourcetree.
When I try to add a new account, I need to login into Gitlab, but the process is always failed.
The message is simple:
Authentication failed
The username and password are correct, I am 100% sure in it because I've tried them in a private session in Chrome.
I'd someone who can explain to me that why I need to login into my Gitlab account if I choose the "Personal Access Token".
I've already created a new token for Sourcetree, but it never asks me just only my basic login data.
Sourcetree is up to date: 3.0.17.2659
You can see a printscreen here about the login flow.

Related

AWS Amplify won't let me sign into the backend

In the terminal I executed this command:
amplify pull --appId d2nb7sae2nlt33 --envName staging
which gave me this response in the termina:
Opening link: https://us-east-1.admin.amplifyapp.com/admin/d2nb7sae2nlt33/staging/verify/
Continue in browser to log in…
In the browser, I'm asked to enter a username and password. I enter my aws root username and password, and I'm told they're incorrect. That username/password works everywhere else in AWS.
Am I supposed to set up some other user name/password for AWS Amplify?
The answer in my case was:
1 You should be clear about which backend you are using. If you have two backends, then d2nb7sae2nlt33 above may not refer to the backend where you have set up your credentials, and
No, the root user is not what you need to enter. The app needs to have an admin user set up. You set it up with a user, which sends an invite to an email, and you respond with a temp password, then set it up with a real password.
go to https://console.aws.amazon.co/amplify (there may be more, like the region, but that's the general idea)
then from the side menu go to Admin UI management under App Settings.
then Invite Users, big orange button in Access Control Settings.
This should get you on your way.

How to overcome the git bash error occur when enable the two factor authentication in GitHub

Very recently I have activated the two-factor authentication on GitHub. Then after I tried to push my work (using git bash)to a new repository and it displays a error as the username or password is incorrect. How can I overcome this issue?
It's likely that you're still using your username and password stored in a credential manager for pushing to GitHub, and that won't work when you're using two-factor authentication. The Git FAQ explains how to empty your credentials (replace your-username):
$ echo url=https://your-username#github.com | git credential reject
Then, the next time you push, Git will prompt your for your credentials. Go to https://github.com/settings/tokens and create a personal access token with the repo and workflow scopes, and then give Git your username when it asks and the personal access token for your password. Don't specify your actual password, since that won't work.
On Windows, you may see a graphical prompt to sign into GitHub; you can just close that window and follow the steps above.

How to use Github Personal Access Token in Jenkins

I can ask this question in many ways, like
How to configure Jenkins credentials with Github Personal Access Token
How to clone Github repo in Jenkins using Github Personal Access Token
So this is the problem
The alternate solution that I am aware of
SSH connection
username password configuration in Jenkins. However,
use of a password with the GitHub API is now deprecated.
But My question is how to setup Github connection with Jenkins using Personal Access Token
[UPDATE]
The new solution proposed by git is
https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/
Which says:
Beginning August 13, 2021, we will no longer accept account passwords
when authenticating Git operations and will require the use of
token-based authentication, such as a personal access token (for
developers) or an OAuth or GitHub App installation token (for
integrators) for all authenticated Git operations on GitHub.com. You
may also continue using SSH keys where you prefer.
What you need to do:
https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/#what-you-need-to-do-today
Basically, change the add URL as
https://<access token>#github.com/<userName>/<repository>.git
Something like this
https://<access token>#github.com/dupinder/NgnixDockerizedDevEnv.git
and set the credentials to none.
Thanks to #Gil Stal
[OLD Technique]
After many discussion on multiple threads from Stackoverflow
I found one thread that is useful.
Refer to this answer:
https://stackoverflow.com/a/61104603/5108695
Basically
Personal access token can be used as a password, as far as Jenkins is concerned at least. I added new credentials to the credential manager.
Go to Jenkins
Go to credentials > System > Global credentials > Add credentials a page will open.
In Kind drop-down select Username and password.
In User put a non-existing username like jenkins-user or user.
Add Personal Access Token in the password field
Now start configuring your project.
source code management tab, select new configured credentials from Drop-down near credential Under Repository URL
So this is how we can configure or setup Authentication between Jenkins and Github using Personal Access Token
References:
Git Clone in Jenkins with Personal Access Token idles forever
Change jenkins pipeline to use github instead of gitlab
The accepted answer wont work anymore because of this: https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations.
You will need to:
Change the URL of the repo to: https://<access token>#github.com/<user-name>/<repo-name>.git (Replace every <...> with the real parameters)
Set the credentials to none.
As of August 2021 the answer posted by Dupinder Singh is accurate. The only thing I would add is that if you are part of a team, the url format appears to be a bit different. This is what worked for me:
https://<access token>#github.com/<team>/<repo>.git
for example
https://ghp_6dh3jdk394jsmbh299jjdg20fh87hd83ksk39#github.com/MyKuleTeam/KuleGuyCode.git
Note that if you use a personal access token you don't need to have any github credentials stored in jenkins.
As for credentials for Jenkins Github Plugin, please be aware only Personal access tokens are now accepted by this plugin.
To generate such a token, follow the Github docs (e.g. here). Don't save it, it can be regenerated in Github and updated in Jenkins if lost or when migrating to a different server.
To add the token do Jenkins credentials store, go to <JENKINS_URL:PORT>/credentials/store/system/domain/_/newCredentials and select Kind "Secret text" (not the default "Username and password"), then paste the token as Secret and choose some ID.
Testing: the credential should appear on the list of Credentials at <JENKINS_URL:PORT>/credentials/ and be selectable from the drop-down list at <JENKINS_URL:PORT>/configure/, where pressing the "Test connection" button should display "Credentials verified for user <GITHUB_USER>".
More info: see the Github plugin docs.
Caveats: Git Plugin has its long-standing issues, so if the newly created "Secret text" does not appear in your pipelines, try if this solution helps (with "the user who triggered the build" considered safer than "SYSTEM"):
client-and-managed-masters/why-credentials-are-not-listed-in-the-git-scm-section
There is (yet another) way to do this as of 2020/04 which is supposed to be superior to personal access tokens. The best part is that you can continue using a username/password-style credential, and the plugin will handle authenticating with GitHub in the background.
Benefits include:
Larger rate limits - The rate limit for a GitHub app scales with your organization size, whereas a user based token has a limit of 5000 regardless of how many repositories you have.
User-independent authentication - Each GitHub app has its own user-independent authentication. No more need for 'bot' users or figuring out who should be the owner of 2FA or OAuth tokens.
Improved security and tighter permissions - GitHub Apps offer much finer-grained permissions compared to a service user and its personal access tokens. This lets the Jenkins GitHub app require a much smaller set of privileges to run properly.
Access to GitHub Checks API - GitHub Apps can access the the GitHub Checks API to create check runs and check suites from Jenkins jobs and provide detailed feedback on commits as well as code annotation
Links:
https://www.jenkins.io/blog/2020/04/16/github-app-authentication/
https://github.com/jenkinsci/github-branch-source-plugin/blob/master/docs/github-app.adoc

How to sign in on locale drone instance

I'm running drone on my Synology NAS and can't find any hint what the password might be. I started with this instruction and added --env=DRONE_USER_CREATE=username:Imperative,admin:true. In gogs personal access tokes, an entry drone is created. Also the logs state the admin account is being created:
{"admin":true,"level":"info","login":"Imperative","machine":false,"msg":"bootstrap: account created","time":"2019-08-26T17:40:17Z","token":"the_random_token"}
I can access the web frontend login at the specified url, but i don't know what login to use. Neither my gogs login or gogs user + the drone token work.
The drone documentation is very rare on the topic.
Edit:
One more observation: when using some random login name, it says Login Failed. Unauthorized. When using my gogs credentials it says Login Failed. Not Found.

Unable to connect to CloudBees through Eclipse

I am trying to follow the tutorial here: http://wiki.cloudbees.com/bin/view/Documentation/CloudBeesEclipseToolkit that describes how to configure your eclipse to use the CloudBees subversion respository. When I get to step 2, and try to validate my account username and password, I get:
Failed to validate your account.
Reason:
Failed to get account services info.
Authentication of user: xxxx failed.;
Details -
Unexpected response code:400. Message: Bad Request
I did use my google account (and oauth?) to create my cloudbees account. I am using my google username and password to try to validate.
The account name is what you see when you enter in cloudbees on the top right.
Regarding your missing password this is due to the fact that google and github sign in don't ask user to define a password - that's why you get an authentication failure.
Users can use https://grandcentral.cloudbees.com/account/forgot_password to request password reset and define the password.
I was able to fix this by clicking on the builds sectio of my account. This led me to some pages that told me I didn't have a password with cloudbees, and prompted me to create one.
When I used this password, instead of my gmail one, validation worked.
Also, I had to use my account name minus #gmaail.com to perform svn checkins, which wasn't the most intuative - it's not clear what un/ow and where