Deprecated password authentication with github warning - github

Hello community can you please help me out, not very knowledgeable in this area
I got an email from git saying that personal password is no longer gonna be supported and that team city was using it so I went into GitHub and generated a token and added to the VCS in the, after our next deploy I got an email from GitHub saying, you are still using the password dummy, so I asked our server guy to update TeamCity as we were several versions behind, so he did and we ran a deploy again today. I pay a visit to the VCS again and saw my Authentication method was set to Password/Token. I got no email from GIT this time saying I was dummy and "Developer Settings/Personal access tokens" mention TeamCity has used it but TeamCity keeps saying this ▼▼▼▼ any ideas ?? Thanks.
git) https://github.com//xxxxxxxxxx is using deprecated password authentication with github.com and will soon stop working
Please consider switching to either personal access token or to SSH private key authentication.
Edit VCS root

Solution as mentioned in the error.
It is also mentioned on TeamCity documentation
You may either use SSH priv/pub keys as authentication or "Personal Access Token".
I can tell by git) https://github.com//xxxxxxxxxx that you are currently using HTTPS instead of SSH to source your VCS, so the most similar solution is GitHub Private Access Token (linked: how-to)
Go to Setting > Developer Settings > Personal Access Token and click "Generate New".
If this is a private GitHub repo, you will need to tick the "repo" scope.
On your TeamCity VCS change the password to be the Personal Access Token you generated.
Tip: since you can not view the PAT after generating nor after using on the VCS, it is recommend to set the PAT as a root configuration variable, so you can call it on this VCS, build features, or other future use.

Related

Heroku/Github set up connection issue?

I am doing an exercise where I've a forked repository, and started a heroku account, did "create a new app" and "deploy with github" but when I go to connect to github, a red error message pops up saying "Error: remote could not connect or was closed."
I have had no problems connecting github to other services, and I've found other people with connection issues, but more along the lines of "why isn't my app working" and mine is" why can't i link the two so I can continue with this exercise?"
Any help is greatly appreciated.
I've followed the instructions after setting up a heroku account, having an app repository fork on github, confirming my email, "create a new app" option on heroku, and on the ensuing "deploy" tab, clicked on the "connect github" option. I expected it to work.
Yes this is a known issue and caused by some data breach related to Github Authorization. Security measures have taken place and Github authorization has been disabled until further notice. Please see
https://github.blog/2022-04-15-security-alert-stolen-oauth-user-tokens/
And based on this ongoing incident,
As reported yesterday, revocation of all OAuth tokens from the Heroku
Dashboard GitHub integration is complete. Until further notice, we
will not issue OAuth tokens from the Heroku Dashboard. These actions,
based on our current understanding of the issue, should prevent
unauthorized access to your GitHub repositories.
We will continue to work with GitHub to provide additional guidance on
how to review your GitHub logs for evidence of exfiltration or
malicious activity. Please reach out to security#salesforce.com with
any information that may assist us with our ongoing investigation.
Please continue to visit status.heroku.com for the latest updates.
If you still want to deploy, you can switch from GitHub to Git quite easily, please read this: https://help.heroku.com/CKVOUPSY/how-to-switch-deployment-method-from-github-to-heroku-git-with-all-the-changes-app-code-available-in-a-github-repo

How to connect my GitHub Enterprise Account with Visual Studio Code

I want to know if it's possible to connect my github enterprise account of my organization to vs code, and if so how?
I know how to sign in with a normal github account on vs code but it doesn't work for github enterprise. I already looked up online but couldn't find any answers.
In the vs code settings there is an option called github enterprise: Uri. I put there the url of my github organization "github.organizationname.com" but I don't know what else I need to do.
Here's what worked for me on vs code 1.62.3.
Clone the GitHub Enterprise repo outside of vs code (ie, using git cli in a terminal or GitHub Desktop).
In vs code, open the folder containing the cloned repo.
And just like magic, it works. If you click on the source control tab in vs code, you can pull changes and make commits. Actually, it might not work quite yet if your cloned project doesn't have your personal access token saved. If you need to do that, you can find instructions in this answer to a different question
I have set it up in the vscode settings like so:
Then it asked for my personal access token. This is token can be created under "settings" -> "developer options"
see: https://docs.github.com/en/enterprise-server#3.4/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
It is possible to login using GitHub enterprise from VS Code without using personal access token or SSH keys. User can login by SSO if session already exist in browser else will need to sign in using their credentials. One of the ways to achieve this is to install Git Credential Manager. Git Credential Manager (GCM) is a secure Git credential helper built on .NET that runs on Windows, macOS, and Linux.
Compared to Git's built-in credential helpers (Windows: wincred, macOS: osxkeychain, Linux: gnome-keyring/libsecret) which provides single-factor authentication support working on any HTTP-enabled Git repository, GCM provides multi-factor authentication support for Azure DevOps, Azure DevOps Server (formerly Team Foundation Server), GitHub, Bitbucket, and GitLab.
For installing GCM based on OS follow the given link:
https://github.com/GitCredentialManager/git-credential-manager
Once GCM is installed and you try to clone a repository you will be able to see Enterprise login page. This can be achieved by using other Git Oauth Authorized Apps such as GitHub CLI.
Another option is to access with you microsoft email and then , the Github enterprise signing option will be added in "Account" just click it and you now will have access to GithubEnterprise
Account bottom in green
more reference here is the link:
https://learn.microsoft.com/en-us/visualstudio/ide/work-with-github-accounts?view=vs-2022

Eclipse Egit and GitHub authentication deprecation

I'm using Eclipse (Egit) and GitHub and I'm receiving this notice:
Hi,
You recently used a password to access the repository with git using JGit/5.10.0.202012080955-r.
Basic authentication using a password to Git is deprecated and will soon no longer work. Visit https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information around suggested workarounds and removal dates.
Currently I'm using HTTPS connection with user and password and probably I have to switch to a HTTPS token, but how can I configure Eclipse/Egit for an HTTPS token?
Github deprecated the authentication of using your personal account password. You will need to change your git credentials in Eclipse to use a personal access token instead of using your Github account password.
Link for creating a personal access token.
Link for changing your credentials in Eclipse.

Azure Devops clone This is not a valid source path in source tree

I have managed to finally add my devops account in sourcetree using the https://orgname.visualstudio.com path
Now I am having issues cloning the repository
I am using the path that devops gives me
https://orgname#dev.azure.com/orgname/MyProject/_git/MyRepo
but I get an error saying
This is not a valid source
The details reveal authentication issues... Yet it authenticated fine when adding the account.
What is going on? Does the azure account have to be the default account?
I managed to fix this by changing from the sourcetree embedded git to my system git Tools>Options>Git>Git Version>Select System. Afterwards when trying again it prompted me to login on my organization domain with 2 factor as if logging in on the devops web app directly.
My system Git is using manager-core for the credential management which is probably not the same system which the embedded version used.
I tried the above solutions (and more) but for me what in the end solved the problem was that the git-password I first wrongly entered when I tried to access the repo had been saved in Keychain (MacOS) and when I tried again this password was used without giving me the option to type it in again. I deleted the password to the Azure DevOps project in Keychain and then got prompted to enter the password again whereafter I pasted the Personal Access Token (!!) generated in Azure Devops and it finally worked!
It could happen when you entered wrong credentials and you don't get asked again, try this:
Go to : Sourtree->Preferences->Advance (tab)
Under: "Default usernames for URLs which do not include one:" delete your wrong credentials.
Try accessing your repo again with right credentials.
This is not the issue which caused by Azure devops. No matter https://xxx.visualstudio.com, or the URL which like dev.azure.com, they should all available git source.
For me, I just try with multi different git URLs, and found the few of URLs are failed with same error with you. But it prompt This is a git repository after I exit the SourceTree and re-configure the clone with same URL which encountered the error previously.
This seems be the most common Sourcetree problem which encountered by many users, not just the URL of azure devops that you occurred.
Check this thread, and try with its recommend way:
Open source tree, Tools -> Options -> Click on Git Tab -> Update
Embedded Git.
Or, consider the method I used: exit the Sourcetree, and re-configure the clone with same URL. (Not recommend since this can not permanently solve this issue)

GitHub Organization Repo + Jenkins (GitHub Plugin) integration

I have an organization on GitHub with private repositories. I also have Jenkins set up running on port 8080 on a server, with the GitHub plugin installed. I've created an account on GitHub for my jenkins user, which resides in the owners group.
I'm trying to trigger a job on jenkins when a change is pushed to my development branch (or master branch, neither seem to be working).
When I look at the GitHub Hook Logs in Jenkins, it says that Polling has not run yet. When I go to "Manage Jenkins", the GitHub plugin says my account is Verified when I test it.
Any insight on how to configure this? I have multiple repositories I'd like to work with, so deploy keys don't seem like the solution to me.
Update:
As Craig Ringer mentions in his answer, you can select Grant READ permissions for /github-webhook in "Configure Jenkins" under the GitHub plugin settings, allowing the webhook to be called without authentication.
Another update: Webhooks are now (Dec. 2014) available for organization: see WebHooks API for orgs.
Note: the issue 4 of the hudson-github-plugin was about:
Last GitHub Push
Polling has not run yet.
And the conclusion was:
Nevermind, the only missing piece was a permission checkbox for the github user which ain't documented anywhere on the internet.
So is this a permission issue regarding your Jenkins users?
The article "Set up Jenkins-CI on Ubuntu for painless Rails3 app CI testing" includes the following process:
To restrict the CI system and give access to your Team members to use or see the build logs, first you’ve to create an account.
Go to Manage Jenkins > Configure System,
Check the Enable Security checkbox
Under Security Realm, choose Jenkins's own user database
Check the Allow users to sign up checkbox
Under Authorization, choose Project-based Matrix Authorization Strategy
Add first user with the name admin and another with GitHub (Note: the username for Admin access has to be admin) For GitHub named user, just choose the Overall Read only permission. We’ll use this user later with the GitHub hook.
Note: The admin and GitHub user that we’ve added in the above step does not create the User. Then you’ve to create a real user with that same name. Ya, I know, its a bit weird with Jenkins UI.
Go to Manage Jenkins > Manage Users > Create User. Create both admin and GitHub users.
Hooking with the Github web-hooks
Now to run the build automagically when new commit or branch gets pushed onto Github, we have to setup the repository.
Got to the hooks page for your repository. e.g.
github.com/<username>/<project_name>/admin/hooks
Under AVAILABLE SERVICE HOOKS > Post-Receive URLs, add github:github#your-ci-server.com/github-webhook/.
The github:github is the user that we’d created earlier.
Then we have to verify Jenkins with Github. Go to Manage Jenkins > Configure System and under GitHub Web Hook, add your Github username and password and click the Test Credential button to authorize once with Github.
It looks like the accepted answer is no longer necessary with the current version of the GitHub plugin. You can instead check Grant READ permissions for /github-webhook in "Configure Jenkins" under the GitHub plugin settings, allowing the webhook to be called without authentication.
As explained in the help on this option that's quite safe, and frankly no worse than having a user named "github" with password "github" anyway.
There are two ways to achieve automatic builds on Jenkins. What you choose depends on whether GitHub can call the Jenkins server URL you provide. This may not be the case if you are running Jenkins behind a firewall.
If GitHub can reach that URL you can set up the service hook on your repo there.
If not you can set up Jenkins to poll periodically.
You may set up both, but one solution is enough to get it working. I would always go for the first if feasible as it saves resources CPU and traffic wise.
Either way you need the GitHub plugin for Jenkins.
Hope that helps a bit.