Is accounts-github still working? (Upgrading GitHub OAuth on Meteor app)

Hi! I’m curious if anyone else has had luck upgrading an application that used GitHub auth with accounts-github@1.4.1 and query parameters (see: Deprecating API authentication through query parameters | GitHub Developer Guide)

Meteor version: 1.7.0.3

The old implementation I had that was working before GitHub deprecated query parameters:

githubAuthRevoke = function(accessToken) {
  check(accessToken, String);
  const clientId = Meteor.settings.github_clientid;
  const clientSecret = Meteor.settings.github_clientsecret;
  const options = {
    headers: {
      "User-Agent": "CodeBuddies"
    },
    auth: `${clientId}:${clientSecret}`
  };
  const response = HTTP.del(
    `https://api.github.com/applications/${clientId}/grants/${accessToken}`,
    options
  );
  const { statusCode = null } = response || {};
  return {
    ok: statusCode === 204
  };

Relevant PRs:

From reading the steps on Authorizing OAuth Apps - GitHub Docs, I’m trying out this new implementation:


What I tried: [Issue 1171] GitHub login - another try by lpatmo · Pull Request #1173 · codebuddies/codebuddies · GitHub

However, the above is failing; I’m not even getting console logs from the implementation. :sweat_smile: I still have accounts-github@1.4.1 installed as a package, so am curious if anyone has had luck upgrading GitHub authentication ever since GitHub announced the deprecation of auth through query params.

Fix is in the pipelines:

Thank you so much @storyteller! Do you know off-hand if github-oauth@1.3.2 will work with Meteor 1.7.0.3? (Will try it, in any case.)

Actually it looks like I’m able to meteor add github-oauth, but meteor add github-oauth@1.3.2 doesn’t quite work… most likely because the PR was merged into the devel branch.

 => Errors while parsing arguments:           
                                              
While adding package github-oauth@1.3.2:
error: no such version github-oauth@1.3.2

Does this mean I do have to upgrade to meteor 2.5 to use this package?

Are you running which version of Meteor?

Patch updates are fine but probably your Meteor version is attached to a different minor version of github-oauth.

You could copy this package to your local packages folder so it would take precedence if you really can’t update Meteor.

BTW, what is preventing you from running latest Meteor? Thanks.

You could copy this package to your local packages folder so it would take precedence if you really can’t update Meteor.

Thanks, that’s helpful to know!

BTW, what is preventing you from running latest Meteor? Thanks.

Only the assumption that the migration would break a lot of code in the project that I don’t have time to maintain :sweat_smile: but the truth is I haven’t tried – so will look into it!

Are you running which version of Meteor?

I am currently running Meteor 1.7.0.3 (I know, somewhat old) and I thought meteor update --release 2.5 would upgrade it, but I am seeing

Unable to update package catalog (are you offline?)
                                              
If you are using Meteor behind a proxy, set HTTP_PROXY and HTTPS_PROXY environment variables or see this page
for more details:  https://github.com/meteor/meteor/wiki/Using-Meteor-behind-a-proxy
                                              
Meteor 2.5: unknown release.  

… will ask about it in a separate thread.

The problem that you are getting in the update command is caused by the change in the Let’s Encrypt root certificate, read more here Expired Certificates | Meteor API Docs

For your case, running Meteor commands in versions before 1.9 you need to have this env var:

NODE_TLS_REJECT_UNAUTHORIZED=0 meteor ....