vue-authenticate
vue-authenticate copied to clipboard
Needed State Parameter [Github]
After logging in in the Gihub, it's asking for the parameter state which the plugin doesn't sends.
Hi @orlyyani,
is state being sent to Github when you are doing authentication?
If no, you might need to specify state as optional parameter in your provider configuration, like this:
providers: {
github: {
clientId: '...',
redirectUri: 'http://localhost:8080/auth/callback',
state: function () {
return new Date().getTime().toString();
},
optionalUrlParams: ['scope', 'state']
}
}
If state is only not being sent in POST request going to your server, then this might be the issue: https://github.com/dgrubelic/vue-authenticate/blob/master/src/oauth/oauth2.js#L43
Make sure your state is either a string or a function returning a string.
I had the same issue, could this configuration added to readme or something, it wasn't the obvious how to use that state and get it shown in the request url.
I'm having issue with facebook provided where I'm setting state similarly to how it explained above it still not presented in facebook popup window? Is that a known issue?