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

Resolving discord bot authentication for Hubs Cloud implementation on AWS #302

Open
JUGERNAUTUS opened this issue Jun 13, 2022 · 2 comments

Comments

@JUGERNAUTUS
Copy link

Hi Hubs Team,

I would be willing to take this up and provide a resolution at my end. I'm new to Elixir and Reticulum and a bit green with AWS but willing to put in the hours to make this work if required

Summary of my request: How I can see reticulum logs in debug mode or monitor request/response to the public internet on AWS? Anything else that would help me debug and resolve this

Im able to get the discord bot working and generate a link for the room. However Im not able to proceed past discord authentication. This is my understanding of the issue till now -

When the user click on the room link generated by the bot and then it asks for a discord authentication and authorization, after authorization, discord sends a code and state params to the redirect url. Reticulum is expected to swap this code for an access token by hitting the discord token URL endpoint (https://discord.com/developers/docs/topics/oauth2). This access token is then supposed to be included in the header of all page requests to hubs.

This functionality works fine for the mozilla hubs (hubs.mozilla.com) setup. The user is able to do a discord authentication and sign in using the Hubs Mozilla bot and if you check the request header, it contains an access token after hitting the redirect url, in the page request.

Unfortunately if you are running a stand alone implementation of Hubs Cloud, the App server API endpoint seems to be unable to receive an access token. If you check the rerouting to the Hubs page after you authorize discord, the access token is missing in the header, hence hubs cloud again asks you to authorize and authenticate with discord

I can see in the Syslog that reticulum is making the request to discord token url to swap the code for the access token. I can also verify that the code has been swapped on discord's end. (If you try to do the swap with postman, it says 'invalid code' - the code has been already swapped). I'm not sure if reticulum is actually receiving the access token, and if it is, why it is not including it in the rerouted request to the hubs page.

Any suggestions from your side that help debug and resolve this issue are helpful. Thanks!

@wsxiaoys
Copy link

It can be fixed with workaround described in #295

@JUGERNAUTUS
Copy link
Author

It can be fixed with workaround described in #295

Thanks! This worked for me

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

2 participants