-
Notifications
You must be signed in to change notification settings - Fork 8
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
[#375] Add optional strict check to aud
member of introspection endpoint response
#378
base: main
Are you sure you want to change the base?
Conversation
Reject access tokens without aud claim
@@ -155,6 +155,15 @@ namespace irods::http::openid | |||
return std::nullopt; | |||
} | |||
} | |||
// Some IAM servers (e.g. keycloak) could be set up | |||
// to exclude `aud' from a bearer token payload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the same convention for highlighting specific properties in comments.
- `aud' -> 'aud' or "aud"
@@ -155,6 +155,15 @@ namespace irods::http::openid | |||
return std::nullopt; | |||
} | |||
} | |||
// Some IAM servers (e.g. keycloak) could be set up | |||
// to exclude `aud' from a bearer token payload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a period to the end of this sentence.
@@ -257,6 +257,10 @@ Notice how some of the configuration values are wrapped in angle brackets (e.g. | |||
// If provided, it MUST be base64url encoded. | |||
"nonstandard_id_token_secret": "xxxxxxxxxxxxxxx", | |||
|
|||
// Determines if the aud member is required in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap aud
in double quotes.
README.md
Outdated
// Determines if the aud member is required in the | ||
// response from the introspection endpoint. | ||
"strict_introspection_endpoint_aud": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain to me what this does?
hmmm....
let's also consider/discuss...
and it occurs to me... is it just the presence of the
|
And to dog-pile onto that... are there other members which we might want to make required? In addition to Maybe this is a naive suggestion, so please shoot down as appropriate. |
Yes, more naming suggestions please!
While this was lower down, going to group with the rest up here. Quick wording suggestion (JSON vs. JWT): - require_aud_claim_from_introspection_endpoint
+ require_aud_member_from_introspection_endpoint
In this PR for the introspection endpoint, by requiring the The checks we do are as follows: irods_client_http_api/core/src/openid.cpp Lines 133 to 157 in 3824a09
Don't think this name is a good fit. While the introspection endpoint does use an access token, we should narrow the name to the endpoint. It may be confusing, as it implies we don't require The standard for the introspection endpoint and the standard for JWT Access Tokens (and ID Tokens) are different. Both the JWT Access Tokens and the ID Tokens are required to have an |
See the "Additional context for the Introspection Endpoint" in my response: #375 (comment) This might be relevant too, not sure: #358 (comment) I'm not too sure we should make the other fields "opt-in require". The authorization server should be doing these checks. Requiring these would mean you need to make sure these members are returned. This means you would need to change the server configuration appropriately. Partial quote of myself from the issue:
|
Thanks everybody for looking into this.
and a successive call to the token introspection endpoint. Clearly, if an access token does not present an aud claim, then the token introspection json response will follow suit.
If this is the case, I am not sure that adding a new configuration parameter (
In my opinion, if the decision taken is the addition of this extra configuration parameter, I would rather choose for a generic
and apply it to both the local JWT validation and the introspection json response. This would make the story more consistent, but it is just an idea. PS: keycloak offers huge flexibility with aud claims. It is possible to exclude an aud claim altogether (not setting it up), add it only to access tokens, to both access tokens and json introspection responses, or to add it only to json introspection responses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From discussion in standup.
Yes, the HTTP API does fall through to using the introspection endpoint if local validation fails. Perhaps this should be changed too? See #380.
While it may make the story more consistent to have a generic If there is interest in having strict enforcement of this member, then it may make sense to have strict enforcement of the other members (see #381). Later on, these options may be enforced by default.
This seems like a test case we should include, thank you for letting us know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks pretty good. a few kory comments still in here too.
awaiting another response from @ll4strw
@@ -235,6 +235,9 @@ constexpr auto default_jsonschema() -> std::string_view | |||
"nonstandard_id_token_secret": {{ | |||
"type": "string" | |||
}}, | |||
"require_aud_member_from_introspection_endpoint": {{ | |||
"type": "boolean" | |||
}}, | |||
"redirect_uri": {{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redirect before require in alpha order
@@ -264,6 +267,7 @@ constexpr auto default_jsonschema() -> std::string_view | |||
"provider_url", | |||
"mode", | |||
"client_id", | |||
"require_aud_member_from_introspection_endpoint", | |||
"redirect_uri", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redirect before require in alpha order
@@ -508,6 +512,7 @@ auto print_configuration_template() -> void | |||
"client_id": "<string>", | |||
"client_secret": "<string>", | |||
"mode": "client", | |||
"require_aud_member_from_introspection_endpoint": false, | |||
"redirect_uri": "<string>", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redirect before require in alpha order
This has the changes made from #376, with the suggestions of that PR applied in this PR.