Skip to content

What cookie(s) should a client request include to authenticate it? #45

Closed Answered by maxcountryman
dsaghliani asked this question in Q&A
Discussion options

You must be logged in to vote

axum-login uses axum-sessions which in turn sets its own cookie (by default this is axum.sid but can be configured to be called whatever you like).

While the docs for RequireAuthorizationLayer do mention the Authorization header in our implementation that part is not relevant: we instead use the middleware directly to obtain a User if one is present. This works because axum-sessions manages the cookie for us and axum-login provides the user context via that.

So the only thing that needs to be passed back to the server is that cookie, axum.sid. This also means the cookie is sensitive and should never be shared. For that reason the cookie uses a number of default settings that help ensure i…

Replies: 1 comment 12 replies

Comment options

You must be logged in to vote
12 replies
@dsaghliani
Comment options

@dsaghliani
Comment options

@maxcountryman
Comment options

@dsaghliani
Comment options

@maxcountryman
Comment options

Answer selected by dsaghliani
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants