-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Return registration_endpoint in OidcProviderConfigurationEndpointFilter #762
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
Return registration_endpoint in OidcProviderConfigurationEndpointFilter #762
Conversation
this(providerSettings, false); | ||
} | ||
|
||
public OidcProviderConfigurationEndpointFilter(ProviderSettings providerSettings, boolean dynamicClientRegistrationEnabled) { |
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.
@sahariardev Adding the flag dynamicClientRegistrationEnabled
to the constructor will not provide us the flexibility we need. There will be other features that are enabled/disabled and adding more flags to constructor provides limited flexibility and API will constantly change.
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.
Hi @jgrandja,
Thanks for your feedback.
One thing we can do is keep this flag inside provider settings as this is a provider related settings. What do you think? Or do you have any better idea for keeping this flag?
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.
One thing we can do is keep this flag inside provider settings
I'd prefer to find an approach that doesn't introduce an "enabled" setting in ProviderSettings
. The less settings there are the easier it will be to use and maintain. Let's try to find a way to implement this without a setting. We know it's disabled by default so we just need to know when it's enabled (based on custom configuration) and then apply the logic in OidcProviderConfigurationEndpointFilter
. Please give it some further thought. No rush.
FYI, I'm on PTO starting this coming Wed and away for just over 2 weeks.
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.
Thanks for your feedback, will try to find a way out
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.
Hi @jgrandja,
I have updated the PR. Please have a look and provider your feedback.
|
||
private boolean isDynamicClientRegistrationEnabled() { | ||
DefaultSecurityFilterChain defaultSecurityFilterChain = (DefaultSecurityFilterChain) WebApplicationContextUtils | ||
.getRequiredWebApplicationContext(getServletContext()).getBean("authorizationServerSecurityFilterChain"); |
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.
Thanks for the updates @sahariardev.
We cannot rely on the bean being called authorizationServerSecurityFilterChain
. The consuming application could name the bean to something different and then this logic would not work.
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.
@sahariardev I might have an idea on how to implement this as part of the work involved for gh-616. Let me think about it for a bit and I'll get back to you.
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.
Okay thanks.
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.
@sahariardev Sorry for the delayed response. I haven't had a chance to revisit this yet. I have some re-factoring tasks that are higher priority at the moment. I will touch base as soon as I get a chance to revisit this.
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.
Okay, no problem.
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.
Thanks for your patience @sahariardev. I just merged gh-616 via 0994a1e.
Based on the updates in that commit, the following code (add to OidcConfigurer.configure()
) will allow you to determine when oidc.clientRegistrationEndpoint()
is enabled so you can apply the registration_endpoint
configuration:
OidcClientRegistrationEndpointConfigurer clientRegistrationEndpointConfigurer =
getConfigurer(OidcClientRegistrationEndpointConfigurer.class);
if (clientRegistrationEndpointConfigurer != null) {
OidcProviderConfigurationEndpointConfigurer providerConfigurationEndpointConfigurer =
getConfigurer(OidcProviderConfigurationEndpointConfigurer.class);
providerConfigurationEndpointConfigurer.addDefaultProviderConfigurationCustomizer(
builder -> builder.clientRegistrationEndpoint("https://localhost/connect/register"));
}
Let me know if you have any questions. Thanks.
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.
Also, please rebase the PR off of 0.4.x
branch.
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.
Thanks @jgrandja. I will update those ASAP.
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.
Hi @jgrandja,
I have started working on this. As I was facing some trouble to rebase with 0.4.x, I had do close this one and opening a new PR. Will let you know the updates ASAP.
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.
Here is the new PR link. let's continue our discussion there.
Before: client registration endpoint was not retuned in oidc Provider Configuration response After: Returns client registration endpoint in oidc provider configuration response if client registration is enabled Fixes gh-370
Before: client registration endpoint was not retuned in oidc
Provider Configuration response
After: Returns client registration endpoint in oidc provider configuration
response if client registration is enabled
Fixes gh-370