Authenticating to a Github remote with name and password - xcode

I need upload project to friend's github account. I have login and password. When I try to push project it's always ask name and password, I try to type login and password or main directory of github (paint out on screen with black) with password, try with empty password, but always take alert that it is incorrect name or password. I try to create repo on github and clone it to my Mac and then copy files to this cloned repo and after commit - push. But again I need type name and password. What is it? Some screens:
repo on github
add repo in xcode
What I need type in this fields?
Try type login and password, title of main directory and password,
git-password, and all this names with empty password field. Always I see:

You are using the SSH URL, which requires you to (generate and) register a public RSA key with Github before you can authenticate.
If this is a one-time thing, you can just switch to the HTTPS URL (see the repo's page on github), which allows you to authenticate with the github username and password combo.
Edit:
For more information about how to generate and use SSH keys, check out Github's SSH help articles
For a detailed comparison of the transport protocols supported by Git and their advantages and disadvantages, with respect to Github, see this comparative article

Related

What credentials to use during 'pod trunk push'?

I have a problem with authenticating my account during pod trunk push because I don't know what username or password I need to use. I have tried my email, as well as typical username which is connected to my Github profile with password, which is stored and was copied from my password manager. What is the biggest possibility I'm doing wrong?
I have tried different username and password scenarios but nothing was working.
To publish a podspec to trunk, the podspec must reference a to public repos.
From https://github.com/Wannabe-games, "The organization has no public repos."
See https://guides.cocoapods.org/making/private-cocoapods.html if you want to work with private CocoaPods.

Force password entry before each GitHub push in VS Code on macOS

How can I force VS Code to ask for my macOS Keychain password before each push to GitHub?
VS Code never asked for my GitHub password (via Keychain) until I pushed to GitHub and it asked before each push again.
This was working until a few hours ago when I had some issues and revoked my access and VS Code requested a new token.
Now VS Code does not ask at all for a password. Even when I remove VS Code from the Keychain whitelist, it asks for my password at program start only once and then not again, even not for pushes.
I want VS Code to request my GitHub token before each push from Keychain again.
After comparing my current macOS login Keychain with one from a Backup where everything was still working as I wanted, I found a solution:
There seem to be at least two ways of how VS Code accesses the Keychain:
Directly via OAuth. This is used when VS Code automatically requests an access token via the GitHub website. It stores the token in the Keychain with the name vscodevscode.github-authentication.
Indirectly via git-credential-osxkeychain and a personal access token that is stored in the Keychain with the name github.com.
VS Code seems to decide automatically which way it uses depending on which keys it finds in the macOS Keychain.
I have not found a way how to force VS Code to ask for the Keychain password on each push when using OAuth, but it is working via git-credential-osxkeychain now.
Solution
Request a personal access token via GitHub / Settings / Developer settings / Personal access tokens
Retreive your GitHub ID via: https://api.github.com/users/<your user name>
Open Keychain Access and create a new password item:
Keychain Item Name: https://github.com
Account Name: <your GitHub ID>
Password: <your personal access token>
Notes:
If VS Code asks for your Keychain password multiple times, try a push via command line
click on Always Allow on the request that asks to ...access key "github.com"...
click on Allow on the request that asks to ...use your confidential information stored in "github.com".
This is a complete "try and error" solution, I have not found much information about that. It would be great if someone could explain what is actually going on here. I have also not found any official information about setting up VS Code via git-credential-osxkeychain.
I guess git needs to be installed to make that work. I installed it via Homebrew
At least for me this solution works for pushing via VS Code GUI, VS Code integrated terminal and OS terminal.
Check your git config --global credential.helper: it references the program in charge of caching your credentials.
A git config --global --unset credential.helper would remove it, forcing Git to always ask for your credentials.

Git clone with personal access token

when I am trying to make git clone in windows shell or cmd it gives me error of authentication, after that I read that I should make personal token instead of password
then I tried to git clone several times with the token but it still gives me the same error
can anyone help ?
If you have correctly generated your ssh keys and added your public key to your account, you should receive a prompt of some sort, asking if you expected to connect to some specific IP address, and then adding that IP address to trusted addresses when you answer yes. If you still get a message about the authentication failing, it could be a matter of you having made a mistake while adding your public key to your account, or git not finding your private key in the expected place. Without getting a look at the specific error message, I couldn't really say, but I would recommend reviewing the steps you took to add the public key to your account.

Change github user in CMD Windows

Right now, my command line is linked to my git account, "Account1".
I want to push to the repository owned by my other account, "Account2"
ex. Right now, when I git push I get:
remote: Permission to Account2/DesiredRepo denied to Account1.
fatal: unable to access 'https://github.com/Account2/DesiredRepo/': The requested URL returned error: 403
How can I login to my other account on cmd to push to that repository? I want something like:
git logout
git login
//Prompts login page of some sort to switch account
I haven't found any solutions so far that work well with windows.
Git has no concept of authentication, so there are no git logout and git login commands. Instead, this is implemented by the protocol used to communicate with a remote. When you installed Git on Windows, you likely accepted the default settings, which includes enabling Git Credential Manager. The first time you entered your GitHub user name and password, this tool stored them (hopefully securely) for use during future sessions. I assume it will allow you to manage your digital identities. You can read this documentation and research further how to switch accounts with this tool.
Alternatively, you can create SSH keys for each account. Add your public keys to the associated account then use the correct private key for authentication. Details are available on the GitHub help pages and documentation.

How to change users in TortoiseSVN

I was setting up another user to use our SVN repository. He didn't have a username/password, so I logged in with my credentials. We now have a username/password for him.
How do I get TortoiseSVN to logout and forget the old password so I can enter the new username/password?
Open Windows Explorer.
Right-click anywhere in the window.
Click TortoiseSVN → Settings.
Click Saved Data.
Click Clear beside Authentication Data (see below).
Check the authentication items to clear.
Click OK.
All saved Authentication Data for all projects is deleted.
You will have to re-enter credentials to reconnect.
There are several ways to do it, through settings or by deleting the cache.
Deleting the cache is the most versatile method. First, locate it:
On XP, it was located here:
C:\Documents and Settings\%USER%\Application Data\Subversion\auth\svn.simple\
On Vista, it was located here:
C:\Users\%USER%\AppData\Roaming\Subversion\auth\svn.simple\
Then look in those files with Notepad, and delete the one with your credentials.
If you want to remove only one saved password, e.g. for "user1":
Go to the saved password directory (*c:\Users\USERNAME\AppData\Roaming\Subversion\auth\svn.simple\*)
You will find several files in this folder (named with hash value)
Find the file which contains the username "user1", which you want to change (open it with Notepad).
Remove the file.
Next time you will connect to your SVN server, Tortoise will prompt you for new username and password.
When you use Integrated Windows Authentication (i.e., Active Directory Single Sign-On), you authenticate to AD resources automatically with your AD credentials. You've are already signed in to AD and these credentials are reused automatically. Therefore if your server is IWA-enabled (e.g., VisualSVN Server), the server does not ask you to enter username and password, passing --username and --password does not work, and the SVN client does not cache your credentials on disk, too.
When you want to change the user account that's used to contact the server, you need use the Windows Credential Manager on client side. This is also helpful when your computer is not domain joined and you need to store your AD credentials to access your domain resources.
Follow these steps to save the user's domain credentials to Windows Credential Manager on the user's computer:
Start Control Panel | Credential Manager on the client computer.
Click Add a Windows Credential.
As Internet or network address enter the FQDN of the server machine (e.g., svn.example.com).
As Username enter your domain account's username in the DOMAIN\Username format.
Complete the password field and click OK.
Now when you will contact https://svn.example.com/svn/MyRepo or a similar URL, the client or web browser will use the credentials saved in the Credential Manager to authenticate to the server.
After struggling with this and trying all the answers on this page, I finally realized I had the incorrect credentials stored by windows for the server that hosts our subversion. I cleared this stored value from windows credentials and all is well.
https://web.archive.org/web/20160614002053/http://windows.microsoft.com/en-us/windows7/remove-stored-passwords-certificates-and-other-credentials
Replace the line in htpasswd file:
Go to: http://www.htaccesstools.com/htpasswd-generator-windows/
(If the link is expired, search another generator from google.com.)
Enter your username and password. The site will generate an encrypted line. Copy that line and replace it with the previous line in the file "repo/htpasswd".
You might also need to Clear the 'Authentication data' from TortoiseSVN → Settings → Saved Data.

Resources