Support

Pre-sales

#41257 Akeeba Social Login-Discord

Posted in ‘Pre-sales and Account Questions’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by nicholas on Friday, 25 October 2024 05:16 CDT

ugr71

Hi.
I just finished a Discord OAUTH2 integration, but there's a problem with Invalid OAuth2 redirect_uri.

My Redirect Url is (as per Akeeba Instructions): http://www.NAME.com/dashboard/index.php?option=com_ajax&group=sociallogin&plugin=discord&format=raw.

When a user click on the Discord button is redirected on:
https://discord.com/oauth2/authorize?response_type=code&client_id=111111111111111111&redirect_uri=http%3A%2F%2Fwww.NAME.com%2Findex.php%3Foption%3Dcom_ajax%26group%3Dsociallogin%26plugin%3Ddiscord%26format%3Draw&scope=identify%20email

In the Discort OAuth2 panel, the redirect URI is:
https://discord.com/oauth2/authorize?client_id=111111111111111111&response_type=code&redirect_uri=http%3A%2F%2Fwww.NAME.com%2Fdashboard%2Findex.php%3Foption%3Dcom_ajax%26group%3Dsociallogin%26plugin%3Ddiscord%26format%3Draw&scope=identify+email

nicholas
Akeeba Staff
Manager

In the Discort OAuth2 panel, the redirect URI is:
https://discord.com/oauth2/authorize?client_id=111111111111111111&response_type=code&redirect_uri=http%3A%2F%2Fwww.NAME.com%2Fdashboard%2Findex.php%3Foption%3Dcom_ajax%26group%3Dsociallogin%26plugin%3Ddiscord%26format%3Draw&scope=identify+email

As per https://github.com/akeeba/sociallogin/wiki/Discord “Discord considers http:// and https:// as well as the non-www and www domain names (e.g. example.com and www.example.com) to be different for the purpose of a redirection URL. If you can access your site as both HTTP and HTTP and as both non-www and www you will need to enter a total of four (4) redirection URLs. Same goes if your site is accessible over multiple subdomains or domains.”

In other words, you will need four redirection URLs:

  1. https://www.NAME.com/dashboard/index.php?option=com_ajax&group=sociallogin&plugin=discord&format=raw
  2. http://www.NAME.com/dashboard/index.php?option=com_ajax&group=sociallogin&plugin=discord&format=raw
  3. https://NAME.com/dashboard/index.php?option=com_ajax&group=sociallogin&plugin=discord&format=raw
  4. http://NAME.com/dashboard/index.php?option=com_ajax&group=sociallogin&plugin=discord&format=raw

 

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

ugr71

Hi, thank you for your really fast reply.
I've done that but still, the error is the same. 4 Redirection URLs added in Discord, discord generated 4 URLs on bottom of the page (to check) and no one is same as the URL from the Button on website:

Redirection URLs added:
http://www.NAME.com/dashboard/index.php?option=com_ajax&group=sociallogin&plugin=discord&format=raw
http://NAME.com/dashboard/index.php?option=com_ajax&group=sociallogin&plugin=discord&format=raw
https://www.NAME.com/dashboard/index.php?option=com_ajax&group=sociallogin&plugin=discord&format=raw
https://NAME.com/dashboard/index.php?option=com_ajax&group=sociallogin&plugin=discord&format=raw

Discord Generated URLs on Discord Page:
https://discord.com/oauth2/authorize?client_id=111111111111111111&response_type=code&redirect_uri=http%3A%2F%2Fwww.NAME.com%2Fdashboard%2Findex.php%3Foption%3Dcom_ajax%26group%3Dsociallogin%26plugin%3Ddiscord%26format%3Draw&scope=identify+email
https://discord.com/oauth2/authorize?client_id=111111111111111111&response_type=code&redirect_uri=http%3A%2F%2NAME.com%2Fdashboard%2Findex.php%3Foption%3Dcom_ajax%26group%3Dsociallogin%26plugin%3Ddiscord%26format%3Draw&scope=identify+email
https://discord.com/oauth2/authorize?client_id=111111111111111111&response_type=code&redirect_uri=https%3A%2F%2Fwww.NAME.com%2Fdashboard%2Findex.php%3Foption%3Dcom_ajax%26group%3Dsociallogin%26plugin%3Ddiscord%26format%3Draw&scope=identify+email
https://discord.com/oauth2/authorize?client_id=111111111111111111&response_type=code&redirect_uri=https%3A%2F%2NAME.com%2Fdashboard%2Findex.php%3Foption%3Dcom_ajax%26group%3Dsociallogin%26plugin%3Ddiscord%26format%3Draw&scope=identify+email

When clicked on Discord Button for Login:
https://discord.com/oauth2/authorize?response_type=code&client_id=111111111111111111&redirect_uri=http%3A%2F%2Fwww.NAME.com%2Findex.php%3Foption%3Dcom_ajax%26group%3Dsociallogin%26plugin%3Ddiscord%26format%3Draw&scope=identify%20email

nicholas
Akeeba Staff
Manager

Ah, it's obvious, isn't it? You never followed the documentation. The information on your first post was misleading.

Remove /dashboard from the ACTUAL redirect URIs you set up in Discord.

 

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

ugr71

Hi Nicholas.

Thank you, it's working.

nicholas
Akeeba Staff
Manager

You're welcome!

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!