Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in OAuth Server: invalid_scope #4

Open
Thimoteus opened this issue Dec 5, 2014 · 7 comments
Open

Error in OAuth Server: invalid_scope #4

Thimoteus opened this issue Dec 5, 2014 · 7 comments

Comments

@Thimoteus
Copy link

I'm using accounts-ui and set up my client id and secret with it. When I go to log in, it says "log in completed" but on the server I get the following:

W20141205-21:40:25.605(1) (oauth_server.js:78) Unable to parse state from OAuth query: µw{²�G�ÛEñÕ�
W20141205-21:40:25.624(1) (oauth_server.js:78) Unable to parse state from OAuth query: µw{²�G�ÛEñÕ�
W20141205-21:40:25.635(1) (oauth_server.js:398) Error in OAuth Server: invalid_scope

The reddit OAuth2 documentation says "Ensure that the scope parameter is a comma-separated list of valid scopes" but I'm not sure what to do with this information.

@Thimoteus
Copy link
Author

OK, I was able to fix this by adding

Accounts.ui.config({
  requestPermissions: {
    reddit: ['read'],
  },
});

but now I'm getting another error saying I need to provide a user agent.

@PandaWhisperer
Copy link
Owner

Thanks for your feedback. I've been pretty busy with other stuff and have not had time to hack on my Meteor stuff recently. In fact, this package was written for a pre-release version of Meteor, so I'm glad it would even work with 1.0.

If you have the bandwidth to track this issue down and fix it, I'd be happy to accept a pull request and give you credit for it.

@mscherer82
Copy link

I got the same problem. The user agent can be added in the reddit-oauth.js in the getIdentity() Method. After adding I got another error:

W20150107-16:26:21.435(1) (oauth_server.js:78) Unable to parse state from OAuth query: {À+é4ç�Qè±Ä
W20150107-16:26:21.437(1) (oauth_server.js:398) Error in OAuth Server: Unexpected OAuth service reddit
I20150107-16:26:21.581(1)? Exception while invoking method 'login' Error: Unexpected OAuth service reddit
I20150107-16:26:21.581(1)?     at middleware (packages/oauth/oauth_server.js:165:1)
I20150107-16:26:21.581(1)?     at packages/oauth/oauth_server.js:146:1

This is fired in the oauth.js of the OAuth package in the middleware function.

var service = registeredServices[serviceName];                           

// Skip everything if there's no service set by the oauth middleware    
if (!service)                                                                         
  throw new Error("Unexpected OAuth service " + serviceName);

I don't know why the service isn't stored in the registeredServices array, because it seems that the OAuth.registerService function will be called correctly.

@PandaWhisperer
Copy link
Owner

Hey guys. Just updated this package for use with Meteor 1.2. Not sure if any of you are still using it, but if you could test it out, would love to hear your feedback. Thanks!

@SimplyLinn
Copy link

I fixed this issue in PandaWhisperer/meteor-reddit-oauth#5 by adding a default scope 'read'.

(A whopping 6 character pull request! but it's my first, you gotta start somewhere.)

@janzheng
Copy link

janzheng commented Oct 8, 2016

for just using Reddit to login, seems like using 'identity' would be the most private scope (for just Oauth login)

@SimplyLinn
Copy link

Ah, you're right. I should have read the reddit documentation better 😞

Ah well I might add another PR at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants