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

Support for Require claim directive #1

Closed
chilt-payx opened this issue May 15, 2019 · 14 comments
Closed

Support for Require claim directive #1

chilt-payx opened this issue May 15, 2019 · 14 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@chilt-payx
Copy link

We were looking to use mod_auth_openidc as a resource server, but saw the deprecation comments in the sample config referencing this plug-in. We need to validate the audience (aud) field in our access token. Is this supported? I reviewed the sample config file provided, but did not see a way to do this.

@zandbelt
Copy link
Member

The current state of things is that you cannot (yet) use any native Require claim aud:<> directive that you would use in mod_auth_openidc. What you can do today is inspect the OAUTH2_CLAIM_aud header value that will be sent to the backend in your application. I hope that is still a valid option for you...

@chilt-payx
Copy link
Author

Unfortunately that will not work for our use case - we want to do the audience validation in the DMZ, which means it must be done in the web tier. Would you recommend we use mod_auth_openidc at this time? Do you expect to support this type of validation in the future?

@zandbelt
Copy link
Member

I recommend that you use mod_auth_openidc for the time being indeed. I am turning this into a feature request.

@zandbelt zandbelt added enhancement New feature or request good first issue Good for newcomers labels May 15, 2019
@zandbelt zandbelt changed the title Support for any claim? Support for Require claim directive May 15, 2019
@zandbelt
Copy link
Member

would you be able to test the latest commit? I have added support for Require claim directives...

@chilt-payx
Copy link
Author

would you be able to test the latest commit? I have added support for Require claim directives...

Is there an RPM installer available that I can use to install it on a test server of ours?

@zandbelt
Copy link
Member

@zandbelt
Copy link
Member

Any luck with testing?

@chilt-payx
Copy link
Author

Any luck with testing?

Sorry, we had a holiday weekend and I am just getting caught up from that. I should be able to run some tests tomorrow (May 31).

@zandbelt
Copy link
Member

how did it work out?

@GRRedWings
Copy link

GRRedWings commented Jan 11, 2021

How do I use these claims? Is it possible to set a specific hd that I want in the jwt?

I have tried

<Location /secure>
#AllowOverride All
# Require valid-user
Require claim hd:mySite.com
AuthType oauth2
OAuth2TokenVerify jwks_uri https://www.googleapis.com/oauth2/v3/certs verify.iat=skip

@zandbelt
Copy link
Member

you need Require oauth2_claim hd:mySite.com

@GRRedWings
Copy link

Thank you for the quick reply, is it possible to chain multiple together?

I have tried
Require oauth2_claim hd:mySite.com and email:me@mySite.com
Require oauth2_claim hd:mySite.com:oauth2_claim email:me@mySite.com

It seems to only take the last item, and the first item is ignored.

@zandbelt
Copy link
Member

By default Apache considers this as a logical OR, in 2.4.x you can use RequireAll to create a logical AND.
See https://httpd.apache.org/docs/2.4/mod/mod_authz_core.html#requireall In your case:

<RequireAll>
    Require oauth2_claim hd:mySite.com
    Require oauth2_claim email:me@mySite.com
</RequireAll>

@GRRedWings
Copy link

GRRedWings commented Jan 12, 2021

Again, thank you for the quick response! I appreciate the work you have done with this and helping those that don't have the strong understanding of Oauth & Apache that you do.

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

No branches or pull requests

3 participants