Unable to push to organization with OAuth App restrictions
See original GitHub issueDescribe the bug
git push
in command line works, but pushing through GH desktop does not. Same issue with publishing a new branch. It does work when I push to one of my own repositories, but it doesn’t if I push to a repo where I have write access but do not own, even when I am the only owner in an organization.
Version & OS
2.1.0-linux1
Steps to reproduce the behavior
- Make any change or create a new branch, to a repo that you have write access to but is not under your account.
- Click Push or Publish branch.
- Auth error pops up and cannot write to repo.
Expected behavior
I should be able to write to any repo that I have write access to.
Screenshots
Logs
2020-02-17T21:13:20.848Z - info: [ui] [AppStore] loading 11 repositories from store
2020-02-17T21:13:20.849Z - info: [ui] [AppStore] found account: Raymo111 (Raymond Li)
2020-02-17T21:13:21.735Z - info: [ui] [BranchPruner] Pruning 0 branches that have been merged into the default branch, master (97c040e6dc4e9e1bc78046936cfe01f126903074), from 'smoothie-web
2020-02-17T21:13:22.010Z - info: [ui] launching: 2.1.0-linux1 (Linux 5.5.4-arch1-1)
2020-02-17T21:13:22.010Z - info: [ui] execPath: '/opt/github-desktop/github-desktop'
2020-02-17T21:13:31.948Z - info: [ui] [Timing] Action 'create commit' for 'bayviewcomputerclub/smoothie-web' took 0.669s
2020-02-17T21:13:33.968Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: smoothie-web - Raymo111 (has token)
2020-02-17T21:14:02.227Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: smoothie-web - Raymo111 (has token)
2020-02-17T21:14:03.333Z - info: [ui] Executing push: git -c credential.helper= -c protocol.version=2 push origin master:master --progress (took 1.065s)
Additional context
Executing git -c credential.helper= -c protocol.version=2 push origin master:master --progress
from command line and then typing in CORRECT username and password gives:
Username for 'https://github.com': Raymo111
Password for 'https://Raymo111@github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/BayviewComputerClub/smoothie-web.git/'
However, just doing git -c protocol.version=2 push origin master:master --progress
works:
Enumerating objects: 19, done.
Counting objects: 100% (19/19), done.
Delta compression using up to 8 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (10/10), 1.36 KiB | 463.00 KiB/s, done.
Total 10 (delta 4), reused 0 (delta 0)
remote: Resolving deltas: 100% (4/4), completed with 4 local objects.
To https://github.com/BayviewComputerClub/smoothie-web.git
7a3bfc5..91bce88 master -> master
So it’s an issue with -c credential.helper=
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Enabling OAuth App access restrictions for your organization
When OAuth App access restrictions are enabled, applications can use an OAuth token to access information about GitHub Marketplace transactions.
Read more >Make errors caused by Oauth App Restrictions clearer
If an organization has Oauth Apps Restrictions enabled, operations on the organization's repository from IDE will fail. To solve this, the IDE Integration...
Read more >Better 3rd Party Error Handling - GitKraken User Suggestions
... the `EXAMPLE` organization has enabled OAuth App access restrictions, meaning that data access to third-parties is limited.
Read more >Owner can't push to organization repository - Stack Overflow
I ran into this problem today and indeed as Ephellon Dantzler suggests, disabling 3rd-party access restrictions fixed it.
Read more >GitHub Integration - CircleCI
So, builds are triggered for all push hooks for the repository and PUSH is the ... However, as a GitHub OAuth app, CircleCI...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i’m having similar issue. after login through linux version, it will not show any organization repo. and when i try to check out a organization repo, it will error out saying auth failed. when i’m trying to login through browser redirect, the app require a separate Oauth app authentication for organization repo, i’m using ubuntu 19.10 this behavior is not present on window and mac version of desktop, both will not require additional Oauth credential and will display organization repo after login.
Still happening.
If you try to go to the folder and push manually this is what I’ve got:
As the above message mentions, it is no longer possible to authenticate with a regular method of username and password on
git push
anymore. Warns and explains to use Personal Access Token to execute.GitHub Desktop and Personal Access Tokens
GitHub Desktop is probably outdated and does not support personal access token on Linux.
Manually pushing changes
Generating personal access token is a proper way to authenticate and push changes.
Tutorial on generating Personal Access Token:
https://techglimpse.com/git-push-github-token-based-passwordless/
Example: Personal Access Token usage via
git push
command:git push https://<GITHUB_ACCESS_TOKEN>@github.com/<GITHUB_USERNAME>/<REPOSITORY_NAME>.git
Manually temporary resolving this issue for a single git repository
You can go into
.git
folder and open upconfig
file. Findremote origin
url
line there and replace its content withBefore
After
Then you can go to the GitHub Desktop and press the
push
button and it will push properly using your personal token.