Closed darkedges closed 1 year ago
@darkedges Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. We prefer to use GitHub issues only for bugs and enhancements.
I am trying to develop an extension within spring authorisation server
Please log an issue describing the feature request so we can decide if the feature is needed.
It's always best to discuss the feature request (via the issue) in order to ensure no work is wasted on your end if the feature is not needed or is not a priority.
Please review the contributor guidelines for additional information.
@jgrandja You mean like this https://stackoverflow.com/questions/74823257/how-to-extend-spring-security-config-and-spring-authorisation-server-in-eclipse
And this https://github.com/spring-projects/spring-authorization-server/issues/210
And this https://twitter.com/DarkEdges/status/1603674422812233728?t=wnc2MQMrHan0roZ-8waUww&s=19
I raised the bug as there is no documentation on how to develop these extensions that require integration with other spring projects.
My fork is at https://github.com/darkedges/spring-authorization-server/tree/feature/par and I am trying to get spring security config work done so that I can configure and test examples with the new extension.
Hope that explains as I am trying to help your team out and get Spring Authorisation Server ready for a big Australian initiative called ConnectID.
@darkedges
I am trying to get spring security config work done so that I can configure and test examples with the new extension
You will need to fork Spring Security and submit a PR to the project. There is no way that I am aware where you can edit the source for both Spring Security and Spring Authorization Server within the same IDE window. You will need to have both projects open in separate windows.
Also note that gh-210 is not a priority feature at the moment and won't be scheduled for 1.1
. It does not have any upvotes.
Also as a reminder, please reach out before you start work on any new feature so the team can determine if it's a priority feature for next release.
@jgrandja if you look at https://github.com/spring-projects/spring-authorization-server/issues/210 that is exactly what I did. I reached out and got no reply, hence why I wrote on StackOverflow and this request.
As for your priority, I have a need to have PAR in Spring Authorisation Server as FAPI 2.0 requires it, so I am trying to get an implementation done ASAP. Wether or not you accept my help is no concern of mine, I am just trying to get a head start on my requirements.
Your response is not helpful. Is this how developer of this project currently work? How do you link the 2 projects, as the core linkage seems to be through spring boot security starter which brings in spring boot security and finally spring boot security config.
So that I am clear I need to
Seems a long and consulated process, but if it the case then I can produce a document saying how to develop the feature and get that added to the wiki or as a how to develop document in this project.
@darkedges
if you look at https://github.com/spring-projects/spring-authorization-server/issues/210 that is exactly what I did. I reached out and got no reply
Apologies for the lack of response. Just so you are aware, we have 2 dedicated (sometimes only me) resources on this project and there is a ton of work and many issues/comments being logged so sometimes it gets missed and at the same time it's difficult to be prompt with our responses. We ask if you can be patient as it would be appreciated.
Your response is not helpful. Is this how developer of this project currently work? How do you link the 2 projects, as the core linkage seems to be through spring boot security starter which brings in spring boot security and finally spring boot security config.
I'm sorry you feel this way but again we have limited resources on this project. And I believe I provided an answer in my previous comment...
There is no way that I am aware where you can edit the source for both Spring Security and Spring Authorization Server within the same IDE window. You will need to have both projects open in separate windows.
What you are trying to achieve I've never done before so I don't have an answer for you.
If I need to merge something in Spring Security then I'll work on my Spring Security fork and submit the PR. After it is merged, I will work on my Spring Authorization Server fork using Spring Security snapshot and integrate my new feature. NOTE: There is no need to work on Spring Boot code - only Spring Security and Spring Authorization Server.
I'm curious, what exactly are you trying to merge into Spring Security? We've provided many hooks in Spring Authorization Server so you might not need to add anything to Spring Security. Please provide some details here and I might be able to save you effort there.
For example, when you configure the DefaultSecurity in
SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws Exception {
http
.authorizeHttpRequests(authorize ->
authorize.anyRequest().authenticated()
).oauth2Login();
return http.build();
public OAuth2LoginConfigurer<HttpSecurity> oauth2Login() throws Exception {
return getOrApply(new OAuth2LoginConfigurer<>());
}
That configuration is within Spring Security Config. So if I wanted to add in the configuration for PAR Endpoint
.pushedAuthorizationRequestEndpoint()
.baseUri(this.authorizationRequestBaseUri())
.pushedAuthorizationRequestRequestRepository(this.pushedAuthorizationRequestRequestRepository())
I need to modify code within the Spring Security project to make this work.
Unlike the code for AuthorizationServerConfig
https://github.com/spring-projects/spring-authorization-server/blob/main/samples/default-authorizationserver/src/main/java/sample/config/AuthorizationServerConfig.java#L66-L67
which uses the getConfigurer
method to get the class from the Spring Authorization Server project.
So when I do something like
http.getConfigurer(OAuth2AuthorizationServerConfigurer.class)
.oidc(Customizer.withDefaults()) // Enable OpenID Connect 1.0
.pushedAuthorizationRequestEndpoint(Customizer.withDefaults());
That works as the code is within the same project.
I am trying to avoid having to recompile / publish code, whilst supporting the framework.
Does that make sense?
@darkedges There is no need to modify code in Spring Security. You can build out support for OAuth 2.0 Pushed Authorization Requests without any modifications to Spring Security or Spring Authorization Server.
Take a look at this commit as a starting point. I've templated out the integration points for the authorization server and client side.
FYI, I'm off until the new year and won't be responding until I'm back in early Jan.
@jgrandja thanks for the update. I see what you have done and I will check to see if I can make this work with the well-known/openid-configuration
endpoint too as that needs to be extended too.
I have already extended that side of the fence in my branch and your option makes it optional to add the end point, which I was achieving by adding the same the same configurer
class, and then checking to see if it has been set in the well known endpoint and adding it.
At some point we need to modify spring security config though? Let me understand that process for myself and get back to the group in the new year.
Thanks once again for your help, and have a merry Christmas and a happy new year.
made a lot of progress, it needs a lot of work to get it working your way as not everything has the necessary hooks. https://github.com/spring-projects/spring-authorization-server/compare/main...darkedges:spring-authorization-server:feature/par?expand=1
After a hiatus I am going to go back to the drawing board on this. Just wanted to know if there has been any more movement on this @jgrandja?
I am trying to develop an extension within spring authorisation server and need to extend spring security config as part of it. I can get both projects to work seperately but when I try and add spring security config as a project dependency to spring authorisation server I get
This is how I am configuring it
settings,gradle
samples-default-authorizationserver.gradle
any examples of how to do this so that I can complete the development? Thanks in advance Nicholas