Git-updater: oAuth for GitHub

Created on 3 Feb 2020  路  17Comments  路  Source: afragen/git-updater

I recently received a notice from GitHub that authorization via an access token query parameter is being deprecated.

https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api/#authenticating-using-query-parameters

https://developer.github.com/v3/auth/

The long term seems to be oAuth and I could use some help.

enhancement feature-request

All 17 comments

I got 108 notices from GitHub today :)

I believe, also mentioned in https://github.com/afragen/github-updater/issues/323#issuecomment-242515699, that PHP League's OAuth 2.0 Client, and it's providers, might be the easiest solution.

The GitHub Provider for OAuth 2.0 Client is at https://github.com/thephpleague/oauth2-github.

Would love to help with this, but I haven't done any OAuth coding before.

@soderlind I welcome any help I can get. I鈥檝e looked at that library and will likely use it. I have done any oAuth coding either.

Hi @afragen

I came here looking for answer re: the email from GitHub that I also got several yesterday.

I've written plugins for wordpress that use OAuth 2.0 with wordpress wp_remote_request. I'm happy to contribute if you need...

@DuckDivers thats awesome!

What I'm looking for is a solution that I can adapt for using with GitHub, Bitbucket, GitLab, as well as private instances of those git servers too. At the moment I'll settle for something that works with GitHub. See #323

I'll push out a branch so we can work on it. Everything will likely be in a separate class.

@afragen @DuckDivers

Looks like there are already provider libraries for Bitbucket & GitLab, according to their 3rd party provider doc.

The only thing that concerns me about the 3rd party libs is that they don鈥檛 seem to be as up to date as the primary client library.

I've created an oauth branch for us to work on. I've added league/oauth2-client to the composer requirements too.

It also seems that I can pass an Auth header with the access token. I'm working on that too as it may be a faster fix.

I think I have a working branch github-basic-auth that solves this problem. You should be able to use the branch switching to test. This is now in develop

Please let me know how it works.

I doesn't work with private repos -- yet.

Testing now on a few sites... I'll see if I get the email from GitHub

I've merged these changes into develop. Also, please test updating especially of GitHub private repos and GitHub repos that use release assets.

What's in developer seems to work with private repos w/ release assets...and no more "nasty-grams" from GitHub...yeah!

The first couple updates I tried failed, but I think those were because of connection problems between me and GitHub. Everything seems to work fine now.

Good job Andy!

HI @afragen - it seems as though your change has broken some other OAuth plugins I've created for constant contact. With github-updater active, it is unable to perform the refresh token, and/or authenticate. I have to disable github-updater for that functionality to work again.

@DuckDivers which version are you currently using?

@afragen 9.3.0 older versions don't break my plugin, but then I get the github depreciation email.

Try the develop branch and let me know.

Develop seems to work as expected. I am able to connect to constant contact now on one of the sites i have this in use on.

Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tdavidrussell picture tdavidrussell  路  4Comments

PthPndr picture PthPndr  路  11Comments

pnoeric picture pnoeric  路  9Comments

alexjose picture alexjose  路  14Comments

picasso picture picasso  路  9Comments