I develop the server for an educational mobile app. Teachers can log in and then create student accounts for their classes. I have my own ASP .NET server, that's communicating with Appwrite for extended functionality. The app calls the REST endpoint e.g. api.mydomain.com/createStudent. This should then check if the teacher is logged in and if so, create a new account. I have it almost working, except the session validation part.
**How can I check on the Server SDK if a user is logged in? ** Currently I send the session cookie with the http request and then try the following:
Client teacher = new Client()
.SetEndpoint(AppwriteSettings.Endpoint)
.SetProject(AppwriteSettings.ProjectId)
.SetKey(AppwriteSettings.ApiKey)
.SetSession(sessionCookie);
var account = new Account(teacher);
User teacherUser = await account.Get();
This throws a 401 AppwriteException with the message: app.<myProjectId>@service.api.mydomain.com (role: applications) missing scope (account)
What am I doing wrong? Isn't the session cookie supposed to be sent with the http request and then authenticate with it on the server side? If not, what's the right way to achieve this?
Thanks in advance for any hint!
Recommended threads
- CORS errors in Obsidian custom plugin
Hi, anyone here familiar with obsidian community plugins? In short: it's a local first note app which supports writing your own add-ons / plugin But I keep get...
- Appwrite 1.9.0 doctor fails tho database...
So i was testing in a local environment the upgrade for 1.9.0, and after getting everything into a running state, i checked the logs that shows : ``` └── Cre...
- Failed to start containers.
I'm trying to install Appwrite locally but struck on the subject point. There is no clear error in logs.