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.
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?
nothing is really added. the account is looked up via email
oh, so discord shares the discord account's email with us and that is what we used to match with the appwrite account?
So then its also impossible to oAuth login a user if they used a different email for the Appwrite account than their discord account?
if so, then I'll probably have to create my own oAuth to assosiate a discord account with their appwrite account.
For now, kind of sort of right ๐
What exactly are you trying to do?
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).
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.
Add custom roles to their discord account?
What's the tech stack for your app?
What version of Appwrite do you have?
Discord roles
V1.3.8
And tech stack for your app?
Appwrite on backend and Flutter frontend mostly right now.
Flutter mobile or web?
Both
But we use raw HTML/js for some things like account verification.
So we can integrate whatever frontend needs we have.
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
They must have a session cookie for this to work
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
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.
I need to figure out how the newer sessions and identifiers work in 1.4.
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?
Recommended threads
- Upgrade Issue
Am having issue upgrading my appwrite account to pro as my card number is 19 and the required input is 16 digit
- createEmailPasswordSession Error using S...
Did someone succeed using SSR approach for login?
- Trying to Figure out how to delete a use...
If i have a button in an app that allows a user to delete their account, can I not just call a function from my swift app to Appwrite to have the account delete...