Back

[SOLVED] Appwrite's Discord Oauth2 expose refresh token on the client side

  • 0
  • Web
Bill.IHCha
11 Jul, 2023, 09:04

Is it possible to not allow the appwrite server to send the refresh token to the client side, only send the token instead?

TL;DR
Appwrite's Discord Oauth2 does not expose the refresh token on the client side. The refresh token is useless without the backend secrets and is not given out in the client credentials grant. It is not safe to send the refresh token to the client side, and modifying the code would be required to prevent the appwrite server from sending the refresh token to the client.
Binyamin
11 Jul, 2023, 13:29

From which endpoint?

Binyamin
11 Jul, 2023, 13:30

Also, I don't think it would be possible without modifying the code.

Bill.IHCha
12 Jul, 2023, 01:27

ah ok, I don't think it's quite safe to send the refresh token to the client right?

Bill.IHCha
12 Jul, 2023, 01:27

getSession

Binyamin
12 Jul, 2023, 01:28

It's only visible to the current user.

Binyamin
12 Jul, 2023, 01:28

So I'm not sure it can be a safety matter

Bill.IHCha
12 Jul, 2023, 01:28

but that means any javascript that is running on the webpage can get the refresh token

Bill.IHCha
12 Jul, 2023, 01:29

alright

Binyamin
12 Jul, 2023, 01:29

Mmm. By running xhr to that endpoint?

Binyamin
12 Jul, 2023, 01:30

That is an interesting way of thinking.

Binyamin
12 Jul, 2023, 01:30

I think we wait and see what Steven's thinking about it.

Bill.IHCha
12 Jul, 2023, 01:30

alright

Bill.IHCha
12 Jul, 2023, 01:31

Btw for client crefentials grant discord doesn't even give out the refresh token, so... https://discord.com/developers/docs/topics/oauth2#client-credentials-grant

Binyamin
12 Jul, 2023, 01:35

It seems like that the refresh token is useless without the backend secrets

Binyamin
12 Jul, 2023, 01:35

So it looks okay

Bill.IHCha
12 Jul, 2023, 01:42

ye fair enough, never thought about that lol

Bill.IHCha
12 Jul, 2023, 02:02

[SOLVED] Appwrite's Discord Oauth2 expose refresh token on the client side

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