Admin
oauth is matched up via email so if a user was created wiht accoutn.create() and then they later log in with oauth2, it will match up as long as the emails match up.
Votes
0
Replies
24
Participants
Unknown
Messages
25
Admin
oauth is matched up via email so if a user was created wiht accoutn.create() and then they later log in with oauth2, it will match up as long as the emails match up.
Rank 4: Virtual Machine
So there is a way to retroactively add oAuth to an existing account and that will allow both email or oAuth login after it is added?
Admin
nothing is really added. the account is looked up via email
Rank 4: Virtual Machine
oh, so discord shares the discord account's email with us and that is what we used to match with the appwrite account?
Rank 4: Virtual Machine
So then its also impossible to oAuth login a user if they used a different email for the Appwrite account than their discord account?
Rank 4: Virtual Machine
if so, then I'll probably have to create my own oAuth to assosiate a discord account with their appwrite account.
Admin
For now, kind of sort of right 😅
Admin
What exactly are you trying to do?
Rank 4: Virtual Machine
We are using discord as the primary community for our product and there are several reasons why we would need to map their appwrite account to their discord account (add custom roles to their account based on the product, and such).
Rank 4: Virtual Machine
In order to make a solution for that, we need the basic concept of mapping their discord to their product account. Without that no functionality can happen, and we should be able to handle a situation where their existing discord account uses a different email than their product account.
Admin
Add custom roles to their discord account?
What's the tech stack for your app?
What version of Appwrite do you have?
Rank 4: Virtual Machine
Discord roles
Rank 4: Virtual Machine
V1.3.8
Admin
And tech stack for your app?
Rank 4: Virtual Machine
Appwrite on backend and Flutter frontend mostly right now.
Admin
Flutter mobile or web?
Rank 4: Virtual Machine
Both
Rank 4: Virtual Machine
But we use raw HTML/js for some things like account verification.
Rank 4: Virtual Machine
So we can integrate whatever frontend needs we have.
Admin
Hmm okay.
Well, the oauth API actually has a feature where if the user already has a session and then they create an oauth session, their current session will be replaced with the oauth session and they'll have the same account. So, then, you can use that oauth session (with the access token) and do whatever against discord.
In 1.4 we introduced identities that leverages this to actually save that discord account as another identifier for that account
Admin
They must have a session cookie for this to work
Admin
If they created an email session in a mobile flutter app and then try to create an oauth2 session, the context where the oauth2 session gets created won't have the email session
Rank 4: Virtual Machine
We'll be upgrading to 1.4 once it's been trial tested a bit more (maybe a bug fix release or 2 more). So this is within the scope of our tech stack.
Rank 4: Virtual Machine
I need to figure out how the newer sessions and identifiers work in 1.4.
Rank 4: Virtual Machine
Not 100% following this yet. So someone who is logged in with a regular email session, who then creates an oAuth2 session will not create an additional identifier for the email session's appwrite account?