desktop icon indicating copy to clipboard operation
desktop copied to clipboard

Authentication failed for a repository with restricted permission

Open yoh-tanimoto opened this issue 11 months ago • 7 comments

The problem

I cannot push a commit to a remote repository or publish a new branch to a repository where I only have a permission to edit non-master-branch. Other repositories work fine.

Release version

Version 3.3.8-linux1 (x64)

Operating system

Ubuntu 22.04.3 LTS

Steps to reproduce the behavior

  1. Switch current repository to a repository where I only have a permission to edit non-master-branch
  2. Create new branch or make a local commit to my branch (already created)
  3. Push origin or publish branch
  4. Get an error message "Authentication failed."

Log files

2024-03-21.desktop..log

The log file after the error reads "2024-03-21T14:37:40.590Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: mathlib4 - yoh-tanimoto (has token)"

Screenshots

No response

Additional context

No response

yoh-tanimoto avatar Mar 21 '24 14:03 yoh-tanimoto

This sounds like an organization repository has restrictions enabled on third-party apps: https://github.com/shiftkey/desktop/blob/linux/docs/known-issues.md#i-cannot-access-repositories-under-my-organization

shiftkey avatar Mar 31 '24 15:03 shiftkey

Sorry, but my organization does have approval of the access to the GitHub Desktop development app. Please see the attached screenshot. Could you please take a close look? Schermata del 2024-03-31 17-52-59

yoh-tanimoto avatar Mar 31 '24 15:03 yoh-tanimoto

Please see the attached screenshot. Could you please take a close look?

I don't know which repository is erroring or it's erroring because I'm not seeing any Git operations in the logs - are you able to share more about the error message that you're seeing?

shiftkey avatar Mar 31 '24 17:03 shiftkey

Thank you for reopening the issue.

In my case, the repository https://github.com/leanprover-community/mathlib4 is giving the error. I have the permission to edit non-master branches (and indeed I am able to edit on GitHub website). I get error when I try to push a commit or publish a branch using GitHub desktop. I attach a screenshot of the error message. Schermata del 2024-04-01 06-53-41

I get the same message even though

  • I am logged in
  • I log out and back in
  • the repository is not archived
  • I do not use SSH

I also attach today's log, where the last 7 lines are related with attempts to publish a branch. 2024-04-01.desktop..log

yoh-tanimoto avatar Apr 01 '24 05:04 yoh-tanimoto

I'm having the same issue. And I'm seeing the same error in the logs:

2024-04-03T07:03:56.933Z - info: [ui] [Timing] Action 'create commit' for 'b-cubed-eu/simcuber' took 0.076s 2024-04-03T07:03:59.996Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: simcuber - PietrH (has token)

It's also failing for a specific repo for me, I'll see if I can figure out if the organisation has some restrictions setup.

Here are my logs:

2024-04-03.desktop.production.log

I'm running Version 3.0.5-linux1 (x64)

Other (completely open) repositories work, CLI works, I can log out and back in.

Is there any other information I can provide?

PietrH avatar Apr 03 '24 07:04 PietrH

I've just replicated the issue in Version 3.3.12-linux2 (x64)

2024-04-03.desktop..log

It seems to me the organisation has the OAuth permissions set for the development app:

image

PietrH avatar Apr 03 '24 07:04 PietrH

Switching to SSH for this repo fixed the issue for me. Push and Pull operations are slower than I'm used to, but this might be because I upgraded to a newer version as well. I prefer using OAuth.

PietrH avatar Apr 04 '24 08:04 PietrH