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

add preserve_path option for cookie session to not override the path #297

Merged
merged 1 commit into from
Nov 25, 2019

Conversation

paulbdavis
Copy link
Contributor

@paulbdavis paulbdavis commented Nov 14, 2019

Related issue

#296

Proposed changes

This adds a preserve_path option to the cookie_session authenticator to allow the original path specified to be used to check the session

Checklist

  • I have read the contributing guidelines
  • I have read the security policy
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got green light (please contact
    [email protected]) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation within the code base (if appropriate)
  • I have documented my changes in the
    developer guide (if appropriate)

Further comments

You can configure as follows:

authenticators:
  cookie_session:
    enabled: true
    config:
      check_session_url: https://example.com/check-session
      preserve_path: true

With preserve_path set to true, all session check calls will go to the path specified in the check_session_url rather than replacing it

I'm not in love with the parameter name, but it's the first thing that came to mind (except using override_path instead, but I don't want to change the default behavior)

I'm also thinking that the original request path should be preserved somewhere when this is set, either as a query param (https://example.com/check-session?path=/original/path) or as a header (X-Oathkeeper-Original-Path: /original/path). Thoughts on that?

Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome - thank you! This looks good to me :)

Could you please document this behavior here: https://github.com/ory/docs/blob/master/docs/oathkeeper/pipeline/authn.md#cookie_session

@aeneasr aeneasr merged commit 7e86b78 into ory:master Nov 25, 2019
@paulbdavis paulbdavis deleted the feature/cookie-session-preserve-path branch November 25, 2019 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants