parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Allow the use of Cookies for authentication

Open R3D347HR4Y opened this issue 10 months ago • 1 comments

New Feature / Enhancement Checklist

Current Limitation

Due to using a SessionToken sent along with each request in the body of the request multiple problems arise: There is no way to operate an application over multiple domains and subdomains without requiring a constant relogging of the user It's impossible to differentiate between authenticated and unauthenticated requests in many CDNs edge functions and so some of the most efficient optimizations are nearly impossible to do (eg. : For every request to Parse Server of unauthenticated users cache the response for 5 min)

Feature / Enhancement Description

Allow for an easy modification of the parse client js sdk and parse server (although that part can easily be done using express.js) to allow users to pass the sessionToken as part of a cookie that could eventually be cross site

Example Use Case

My Application is an online portfolio platform, users are allowed to set a custom domain to it in order to make it theirs, but they should be able to retain authentication in order to send messages and edit their portfolio

Alternatives / Workarounds

Editing the server part in order to transform a cookie into a sessiontoken in the body although impractical is possible in express.js, but I have found no way to override the Rest controller on the Parse SDK JS, the only other way possible would be to implement all parse sdk js from scratch and use a custom axios but this is way too complex

3rd Party References

Mostly every major platform uses cookies for auth

R3D347HR4Y avatar Apr 01 '24 13:04 R3D347HR4Y