Back

[SOLVED] Discord Oauth not save cookie in development

  • 0
  • Users
  • Web
Bill.IHCha
27 Jun, 2023, 09:03

Is it possible to config it or am I forced to add another redirection? Appwrite is self-hosted behind a proxy.

TL;DR
User is experiencing an issue with Discord Oauth not saving cookies in development. They are wondering if there is a configuration option or if they need to add another redirection. They also express dislike for how Appwrite is using email and handler for user identification and inquire about using a user ID instead. User mentions running Appwrite behind Apache2 and wonders if that could be causing the issue. They also mention needing to link a Discord bot to the frontend and ask about workarounds and receiving scope information after redirection. Several users recommend proxying to Appwrite using HTTPS for better compatibility. Appwrite has a feature to redirect HTTP to HTTPS. User mentions
Bill.IHCha
27 Jun, 2023, 09:06

Adding an extra redirect url in discord developer protal works bc my proxy automatic forward the traffic, but is there any other way to set the redirect_uri to https

Bill.IHCha
27 Jun, 2023, 09:24

and for the Discord Oauth2 I really dislike how Appwrite is using the email and handler for the user. What if the user changed their Discord linked email? Is it possible to use the user ID or something like that instead

Bill.IHCha
27 Jun, 2023, 09:50

and I'm facing the same issue as <#1114801897405173771>, maybe it's the cookie reason? I'm running Appwrite behind Apache2, maybe that might cause some issue?

Bill.IHCha
27 Jun, 2023, 10:22

This is because I have to link a backend which is a discord bot to the frontend. Just by reading the email I have no idea who is who because the backend stores the user id. Is there any workaround for this? And I see there is a optional argument for the scope, is there anyway I can receive that information in my app after the redirection?

Drake
27 Jun, 2023, 12:04

You should be proxying to Appwrite using https

Bill.IHCha
27 Jun, 2023, 12:06

I tried, things got broken and I stayed. I use my own SSL and stuffs, with other services running as well

Bill.IHCha
27 Jun, 2023, 12:07

Is there any config or anything that tells appwrite to redirect to https?

Drake
27 Jun, 2023, 12:07

The appwrite session that is created should have a provider user id. If that isn't the right value, you can probably use the provider access token to make API calls to discord and fetch the username.

Bill.IHCha
27 Jun, 2023, 12:07

Appwrite uses traffic or whatever that proxy service called and I use Apache2, bit of incompatibility

Drake
27 Jun, 2023, 12:08

Yes, Appwrite has a feature to redirect http to https

Drake
27 Jun, 2023, 12:08

Your SSL in front of your proxy shouldnt matter

Bill.IHCha
27 Jun, 2023, 12:09

How to check?

Bill.IHCha
27 Jun, 2023, 12:09

Ye, but for some reason a lot of problem occurs when I proxy https to https, so I just stayed

Drake
27 Jun, 2023, 12:10

What problems?

Bill.IHCha
27 Jun, 2023, 12:11

Such as login fails, or page not being served. It's been a while ago can't remember all

Drake
27 Jun, 2023, 12:12

Weird...I highly recommend proxying to Appwrite using https

Bill.IHCha
27 Jun, 2023, 12:12

I'll try next time I get on

Bill.IHCha
27 Jun, 2023, 12:12

But HTTP works tho

Bill.IHCha
27 Jun, 2023, 12:12

Even realtime

Bill.IHCha
27 Jun, 2023, 12:13

So basically not use the appwrite auth system?

Drake
27 Jun, 2023, 12:13

You already ran into the http redirect problem. You may also run into a cookie problem

Drake
27 Jun, 2023, 12:14

No, you get the session after logging in

Bill.IHCha
27 Jun, 2023, 12:14

It did turns out fine when I add another redirect in discord dev portal, and it's just the problem the the url parameter that appwrite redirected named "redirect_uri=http..."

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more