shiftkey / desktop

Fork of GitHub Desktop to support various Linux distributions
MIT License
6.68k stars 504 forks source link

development OAuth app details set #72

Open iamthadiyan opened 5 years ago

iamthadiyan commented 5 years ago

Description

Installed 1.4.2 Linux RC1 in Ubuntu 16.04.5 LTS. Doing Enterprise login, OAuth fails with 404 error. The same procedure fine when tried with latest Windows client

Version

Steps to Reproduce

  1. Launch desktop in Ubuntu 16.04.5 LTS
  2. Click File->Options->Accounts->Enterprise Signin
  3. Enter Enterprise URL
  4. Click on 'Sign In'
  5. Enterprise URL

Expected Behavior

OAuth to succeed and Desktop able to list repositories.

Actual Behavior

404 Page when redirected for OAuth. The same steps works correctly from windows version.

Additional Information

Logs

I do not know where to look for linux logs.

shiftkey commented 5 years ago

Yep, I know what this is - I'd change the deployment processes around in #63 and I neglected to add the production OAuth Client ID and Client Secret to the build process.

shiftkey commented 5 years ago

For the moment I'm going to leave the OAuth Client ID and Secret as-is for these installers, because the other OAuth details are associated with the official apps and I shouldn't be using them to make installers generated from this fork.

While it's great to hear that you're trying to use this with GitHub Enterprise, the current priority for Linux support is to test the installers and app across a range of distros, so I'm going to leave this with the developer OAuth details set the moment (that will continue to work fine with GitHub.com).

mryan43 commented 5 years ago

here's my not-so-useful +1, our org also needs a fix for this !

anish-joy commented 5 years ago

When will this issue be fixed? Is there any alternate way to fix this issue, locally or organizational level until the alpha version releases!

smcfizz commented 5 years ago

I have a very similar issue as well. When I enter my credentials for my organization in the GitHub Desktop app I receive

"The server responded with an error while attempting to authenticate (422)\n Unprocessable Entity"

and if I choose to "sign in using your browser" I am redirected to a 404, as described above.

davidmcl commented 5 years ago

Unfortunately, this bug makes your tool useless for me...my clients are not going to remove the 3rd party app restrictions. My scenario isn't on Enterprise, just Organizations.

shiftkey commented 4 years ago

Just to bump this with a comment from https://github.com/shiftkey/desktop/issues/229#issuecomment-604639903

What you suggest to do then? On windows and Mac is working properly.

This is because I maintain the unofficial releases for Linux, and it doesn't contain the OAuth details required to behave the same. This is being discussed in desktop#1525 (please upvote if you care) but #72 is tracking this known limitation.

As I want to keep this separate until the team is interested in official support, the only other option here would be for me to embed a new set of OAuth details that would belong to a distinct entity to avoid confusion with the main "GitHub Desktop" product. That's branding work I'm not able to take on currently, and I want to focus currently on ensuring the app installs and works on various distros.

Introducing a new brand also won't address the solution completely because organization administrators need to approve access to this new application.

The command line works here because you're creating a token directly associated with your account, rather than delegating to an OAuth application.

istiak101 commented 4 years ago

https://github.com/settings/applications

Click on "The GitHub Desktop Development App"

Scroll down to "Organization access"

You can grant or revoke access to organizations individually.

subversivo58 commented 4 years ago

I was having trouble displaying repositories and organizations when logging in using a username and password ... OAuth authentication worked for me in versions past after but not anymore.

Using Linux Mint 19.3 or 20 in the latest version (2.5.3 Linux RC1) I was unable to return OAuth from the browser because the web schema was not registered in the application's mime-type.

OAuth web: (code and state omited)

x-github-desktop-dev-auth://oauth?code=xxxxxxxxxxxxxx&state=yyyyyyyyyyyyyy

Application MimeType: (/usr/share/applications/github-desktop.desktop)

[Desktop Entry]
Name=GitHub Desktop
Comment=Simple collaboration from your desktop
Exec="/opt/GitHub Desktop/github-desktop" %U
Terminal=false
Type=Application
Icon=github-desktop
StartupWMClass=GitHub Desktop
MimeType=x-scheme-handler/x-github-client;x-scheme-handler/x-github-desktop-auth;
Categories=GNOME;GTK;Development;

I had to manually add a new schema to the mime-type list by editing it:

sudo -H subl /usr/share/applications/github-desktop.desktop

I used Sublime but I believe that any editor will do and I added the schema that OAuth uses on the web to open "xdg-open"

x-scheme-handler/x-github-desktop-dev-auth;

Finally update mime types database

sudo update-desktop-database 

The OAuth link now returns to the application and authorization is completed, listing all repositories and organizations.

I believe this mime type is missing from the build and I hope this helps because OAuth for now is the only authentication method listing all repos and organizations.

shiftkey commented 4 years ago

@subversivo58 please open a new issue for what you're seeing as that's a separate issue to this thread, and I'd like to hear more about your setup.

sc-sycer commented 3 years ago

https://github.com/settings/applications

Click on "The GitHub Desktop Development App"

Scroll down to "Organization access"

You can grant or revoke access to organizations individually.

This! Please, put this into a FAQ or something! When I granted the access to organizations into github.com to the desktop application, my private repos began to work!

remenkemi commented 11 months ago

https://github.com/settings/applications

Click on "The GitHub Desktop Development App"

Scroll down to "Organization access"

You can grant or revoke access to organizations individually.

I don't seem to have any organization access settings. I saw the options on other OAuth apps but not this one. Screenshot 2023-09-11 23 34 02

o-hnne commented 5 months ago

So is it normal that View on Github, Create issue on Github and Preview Pull Request/Create Pull Request so basically stuff tied directly to Github.com is not working on an organisation repo compared to the Windows application even though Github Desktop and The Github Desktop Development App are OAuth authorized by the organisation?