invalid_scope
error from Discord after using auth URL provided by generateAuthUrl
.
#33
Labels
good first issue
Good for newcomers
Describe the error
generateAuthUrl
generates what appears to be a valid URL, but upon hitting "Authorize" on the discord.com page, I get a URL back with the querystring?error=invalid_scope&error_description=The+requested+scope+is+invalid%2C+unknown%2C+or+malformed.&state=<my state>
.NodeJS version
v12.18.4 (from
node:lts-alpine
on Docker Hub)Relevant code
process.env.DISCORD_USERSCOPES
is"identify connections guilds relationships.read"
.state
iscrypto.randomBytes(16).toString("hex")
.The URL this generates is
https://discord.com/oauth2/authorize?client_id=<my client id>&redirect_uri=https%3A%2F%2F<my redirect uri>&response_type=code&scope=identify%20connections%20guilds%20relationships.read&state=<my state>
.The page on Discord appears to understand this:
However, on clicking Authorize, it returns me to this URL:
https://<my redirect uri>?error=invalid_scope&error_description=The+requested+scope+is+invalid%2C+unknown%2C+or+malformed.&state=<my state>
The redirect uri and the state both match the generated URL.The scopes are valid and are listed under https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes. Any idea what I am doing wrong here?
The text was updated successfully, but these errors were encountered: