Git Product home page Git Product logo

reddit-oauth-helper's Introduction

reddit-oauth-helper

A quick, intuitive script that creates reddit oauth tokens for you

How to use

Web Interface

Link

Command Line

$ npx reddit-oauth-helper

Example screenshot

reddit-oauth-helper's People

Contributors

benwaffle avatar emenardc avatar harshitjoshi9152 avatar markspolakovs avatar not-an-aardvark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

reddit-oauth-helper's Issues

'reddit-oath-helper@latest' is not in the npm registry.

me@a360:~$ npx reddit-oath-helper
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/reddit-oath-helper - Not found
npm ERR! 404
npm ERR! 404  'reddit-oath-helper@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /mnt/c/Users/me/.npm/_logs/2020-04-28T05_19_13_534Z-debug.log
Install for [ 'reddit-oath-helper@latest' ] failed with code 1

Bad Request Error

image
I was trying to create a token for a script.
However, after selecting all options, it link which is generated, shows "Bad Request."
image

Character `-` not recognized

When copy/pasting a client secret with a dash, reddit-oauth-helper does not function.
After creating several apps on reddit and finally getting a secret without a dash, the program worked just fine.

Please enter your client secret. This is the 27-character string that appears when you click "edit" next to your 
app on this page: https://www.reddit.com/prefs/apps

Add support for all three app types

At the moment, only the "personal use script" app type is supported.

  • There should probably be a question at the beginning asking which script type is being used.
  • "installed app" app types are pretty much the same as "personal use", except that the client secret is always blank, so that question can be skipped.
  • "web app" app types are a bit trickier. The process itself is exactly the same as the "personal use script" process. However, it's possible that the app is already in use on a production server, in which case telling the user to change the redirect URI to a localhost address might not be a good idea.
    • Option 1: Prompt the user for a username/password, use cookie-based authentication to click the "accept" button, and then capture the code without going to the redirect URI.
      • Pros:
        • Simple for the user
        • No need to risk breaking a running webapp
      • Cons:
        • User might not want to enter their password into a command-line prompt
        • Using cookie-based authentication is technically against the reddit API rules, even if it's used in the process of getting an OAuth token
        • Making the user press the button on reddit ensures that they know exactly what they're granting access to
    • Option 2: Open the browser page as usual, but prompt user for the access code rather than listening for it on a local server
      • Pros:
        • The user is able to consciously grant access on the reddit site
        • No need to ask for a password
      • Cons:
        • Getting the one-time use code can be kind of a difficult process for the user -- it's passed as a querystring parameter to the redirect URI, but the server at the redirect URI might immediately redirect the user again and remove the querystring parameter.
    • Option 3: Don't change anything, require people to change the redirect URI on the web app
      • Pros:
        • Consistent process for everything, no unnecessary complications
      • Cons:
        • If the web app authenticates end-users through OAuth, this functionality will break for a short period of time while the redirect URI is different. (Granted, the entire process of using reddit-oauth-helper probably takes a maximum of 5 minutes, but the downtime is still undesirable.)

Ratelimit

Hello,
I use oauth authorization but I still ratelimit problems.
I use this code, but my requests are not processed.

  const r = new snoowrap({
          userAgent:    '---',
          clientId:     '-----',
          clientSecret: '----',
          refreshToken: '------'
  })        
  r.config({requestDelay : 1010, continueAfterRatelimitError : true, })

Client secret is not 27 characters

I am not able to use the cli because it is saying that the client secret should be 27 characters, but mine is 30 characters.

Please enter your client secret. This is the 27-character string that appears when you click "edit" next to your app on this page: https://www.reddit.com/prefs/apps

Can't generate permanent tokens

I'm trying to generate a permanent token for my app, so I can put it in an .env file,. and move on to the logic :)

The only permission I need is "read". Regardless of whether I mark the permanent check box on https://not-an-aardvark.github.io/reddit-oauth-helper/ or not, the response comes back with a token limited to an hour. I've tried everything - it always comes back with:

{
  access_token: "number-string"
  token_type: "bearer"
  expires_in: "3600"                     <-- culprit
  scope: "read"
}

I tried using the command line version (with npx): changed the redirect_uri for my app, ran the command line, and got the exact same result. It ends up generating this URL:

https://www.reddit.com/api/v1/authorize?client_id=myclientid&response_type=code&state=somestring%2Bkg%3D%3D&redirect_uri=http%3A%2F%2Flocalhost%3A65010%2Fauthorize_callback&duration=permanent&scope=read

The problem is, after a token expires, snoowrap fails in spectacular ways (returning HTML instead of Listings object etc.), so I must have a permanent token.

Is it something to do with Reddit itself? My app? Something in the code?

Thanks!

You broke reddit

Seems like no matter what I try I just get You broke reddit error on the step when browser opens up.

CLI requires Client ID be 14 characters

Hello! Thanks for making this script/app, it's very useful.

When I tried to get a token via the CLI, I got stuck trying to submit a Client ID as it was checking for a 14 character string when my Client ID is 22 characters long.

However when I switched to using your hosted web interface, I was able to use my Client ID without issue.

I don't know if the fix is as simple as removing the length limitation so I'll leave this as an issue and not a PR.

Thanks again!

Fix token selection in web view

You currently can't select the generated tokens in the web view, making it hard to copy them to the clipboard.
This seems to be due to the disabled property on the input elements, this should be replaced by the readonly property.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.