question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Oauth2 with Reddit

See original GitHub issue

I had to added the following after line 163 in oauth2.js (method getOAuthAccessToken) to get Reddit to work:

   'Authorization' : 'Basic ' + new Buffer(this._clientId + ':' + this._clientSecret).toString('base64') ,

This header addition did not seem to break Instagram or Google Oauth2.

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
sebilassecommented, May 24, 2016

You can override the prototype – a lot of Passport strategies are currently doing so and so is Reddit : https://github.com/Slotos/passport-reddit/blob/master/lib/passport-reddit/strategy.js –> see the comment

// Reddit token endpoint expects basic auth header "with the consumer key as the username
// and the consumer secret as the password". To comply we are resorting to overriding
// node-oauth's implmentation of getOAuthAccessToken().
0reactions
noiissyboycommented, Dec 7, 2021

You can override the prototype – a lot of Passport strategies are currently doing so and so is Reddit : https://github.com/Slotos/passport-reddit/blob/master/lib/passport-reddit/strategy.js --> see the comment

// Reddit token endpoint expects basic auth header "with the consumer key as the username
// and the consumer secret as the password". To comply we are resorting to overriding
// node-oauth's implmentation of getOAuthAccessToken().

Thats great sebilasse, is there any typescript implementation?

Read more comments on GitHub >

github_iconTop Results From Across the Web

OAuth2 · reddit-archive/reddit Wiki - GitHub
OAuth2 support allows you to use reddit to authenticate on non-reddit websites and applications. Looking to jump right in?
Read more >
I'll admit it, I'm stupid, how do I do the OAuth2 authentication?
You do a POST request to reddit and it gives you API credentials. If you want to know more about web app, read...
Read more >
Reddit OAuth: Let Users Sign into Your App With Reddit Login
Reddit OAuth (Open Authorization) allows users to authenticate your application using their Reddit account. Your application can do this by ...
Read more >
Implement Login with Reddit | Reddit OAuth2 | NodeJS
Create an application in Reddit https://www. reddit.com/prefs/appsReddit API Docs ...
Read more >
Oauth2 authentication for reddit - Desktop Liberation
For more information see OAuth2 for Apps Script in a few lines of code. ... You need to set up your application on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found