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

allow specifying additional headers for the oauth introspection request #302

Merged
merged 2 commits into from
Nov 25, 2019

Conversation

paulbdavis
Copy link
Contributor

Proposed changes

Adds the option to specify additional headers to the oauth introspection request. The main use case is for adding an X-Forwarded-Proto header for communicating with an internal hydra instance.

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

Assuming this is accepted in general, I'll also add this feature to the oauth client credentials athenticator

@@ -96,7 +106,7 @@ func (a *AuthenticatorOAuth2Introspection) Authenticate(r *http.Request, config
}

if !i.Active {
return nil, errors.WithStack(helper.ErrForbidden.WithReason("Access token i says token is not active"))
return nil, errors.WithStack(helper.ErrUnauthorized.WithReason("Access token i says token is not active"))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return nil, errors.WithStack(helper.ErrUnauthorized.WithReason("Access token i says token is not active"))
return nil, errors.WithStack(helper.ErrUnauthorized.WithReason("The provided Access Token is invalid, expired, or malformed."))

"introspection_request_headers": {
"title": "Introspection Request Headers",
"description": "Additional headers to be added to the introspection request.",
"type": "object"
Copy link
Member

Choose a reason for hiding this comment

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

Could you add an example please?

"examples": [{ "X-Whatever": "foo" }]

@aeneasr aeneasr merged commit b1e5cea into ory:master Nov 25, 2019
@paulbdavis paulbdavis deleted the feature/oauth-request-headers 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