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

Scope field is not working #29

Open
gocerk opened this issue Apr 16, 2022 · 0 comments
Open

Scope field is not working #29

gocerk opened this issue Apr 16, 2022 · 0 comments

Comments

@gocerk
Copy link

gocerk commented Apr 16, 2022

I'm giving the scope field to the passport.authenticate() but it doesn't redirect me to the Instagram auth URL with query scope parameters.

Here is my code

Router.get('/instagram/callback', (req, res) => {
    passport.authenticate('instagram', {
        scope: ['user_profile', 'user_media'],
        successRedirect: '/profile', 
        failureRedirect: '/login',  
        session: true
    });

    res.json({'status': 'success'});
});

It redirects the user to the https://www.instagram.com/oauth/authorize/?response_type=code&redirect_uri=https://localhost:3000/auth&client_id=my_client_id
As you can see there is no scope query parameter. And unfortunately, Instagram gives an error like this;

{
"error_type": "OAuthException",
"code": 400,
"error_message": "Invalid scope: []"
}

How can I add scope?

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

1 participant