Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookie rocket_oauth2_state with secure flag #38

Open
atezet opened this issue Nov 2, 2022 · 2 comments
Open

Cookie rocket_oauth2_state with secure flag #38

atezet opened this issue Nov 2, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@atezet
Copy link

atezet commented Nov 2, 2022

In https://github.com/jebrosen/rocket_oauth2/blob/0.5.0-rc.1/src/lib.rs#L693 the rocket_oauth2_state cookie is set. By default, Rocket's add_private securely configures cookies with httponly(true), however the secure flag is not set. Would it be possible to add a possibility to set the secure flag on this cookie? Either automatically when a secure connection is used (not sure if this is possible), or somehow in the configuration? Or just make it the default for production builds?

I am also considering to suggest this on Rocket as a default instead, as I think it would better to use secure defaults (at the very least for production builds).

@jebrosen
Copy link
Owner

I believe this was for a reason, but it may be time to revisit this. The most likely reasons I remember were:

  • Ability to test locally on e.g. http://localhost:8000. This may be a good reason to not use Secure unconditionally, but a flag or method to opt in to the Secure attribute would work
  • Buggy or inconsistent browser behavior with Secure, SameSite, and redirects, making Secure nonviable

@jebrosen jebrosen added the enhancement New feature or request label Feb 22, 2023
@atezet
Copy link
Author

atezet commented Feb 22, 2023

Thanks for your response. I discussed some options in rwf2/Rocket#2425, I just haven't found any time to look at it any further

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants