Skip to content

Can't authenticate using httpx AsyncClient #1237

Answered by frankie567
mixa2130 asked this question in Q&A
Discussion options

You must be logged in to vote

Are you sure you set the cookie secure flag to False, as I mentioned in my previous answer?

https://github.com/mixa2130/events_registration_api/blob/55d6e8dc9249c12269510510e7b28d7b7eccba42/src/auth/config.py#L12

The default is True. My recommendation is to have an environment variable for this so you can easily switch it to False in local and to True in production.


@frankie567 why do you think that set-cookie value cant't be used to auth?

The value of Set-Cookie contains not only the cookie name and its value, but also the flags like HttpOnly, Secure, etc.

The Cookie header only expects Name=Value pairs. So, I'm not sure the server is able to recognize them if they contain the flags. …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@mixa2130
Comment options

@mixa2130
Comment options

@frankie567
Comment options

Answer selected by mixa2130
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