-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat: add OAuth2 sample applications and configurations #4594
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
base: master
Are you sure you want to change the base?
feat: add OAuth2 sample applications and configurations #4594
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4594 +/- ##
============================================
+ Coverage 83.64% 83.78% +0.14%
+ Complexity 1247 1214 -33
============================================
Files 156 158 +2
Lines 3644 4027 +383
Branches 258 255 -3
============================================
+ Hits 3048 3374 +326
- Misses 464 531 +67
+ Partials 132 122 -10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
I'm not sure about the naming and how the projects play together. Regarding the linked issue I would expect
- the admin server to be the oauth-client
- the monitored app to be the resource server
right? 🤔
Also your PR description mentions documentation but there is none.
To me this looks like (incomplete) AI generated code that is just creating an oauth sample but not really getting the relation to Spring Boot Admin.
|
||
<modules> | ||
<module>spring-boot-admin-sample-custom-ui</module> | ||
<module>spring-boot-admin-sample-servlet</module> |
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.
why did you remove this sample?
<module>spring-boot-admin-sample-war</module> | ||
<module>spring-boot-admin-sample-hazelcast</module> | ||
<module>spring-boot-admin-sample-oauth2</module> | ||
<module>spring-boot-admin-sample-oauth2-client</module> |
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.
We were recently discussing if it is really useful to add more samples here. It is increasing build-time and makes git operations slower.
Maybe it would be better to put them in https://github.com/codecentric/spring-boot-admin-runtime-playground and advertise this repo more. I will discuss that with the rest of the team.
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<dependencies> |
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.
Do you really need all those dependencies? The demo app is not doing anything, so seems we can reduce here.
import org.springframework.web.client.RestTemplate; | ||
|
||
@Configuration(proxyBeanMethods = false) | ||
public class OAuth2RestTemplateConfig { |
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 you are mixing different samples, because you use the servlet sample for oauth sample, that will cause confusion.
Description
Resolves #1195 by adding comprehensive OAuth2 sample implementations for Spring Boot Admin.
Changes Made
New Modules
spring-boot-admin-sample-oauth2
- Admin Server with OAuth2 login integrationspring-boot-admin-sample-oauth2-client
- Monitored application configured as OAuth2 Resource ServerKey Components
Admin Server (OAuth2 Client):
OAuth2SecurityConfig
- OAuth2 login configuration withoauth2Login()
OAuth2RestTemplateConfig
- RestTemplate with OAuth2 client credentials supportSpringBootAdminOAuth2Application
- Main application with@EnableAdminServer
Client App (OAuth2 Resource Server):
OAuth2ResourceServerConfig
- JWT-based resource server protecting actuator endpointsOAuth2ClientApplication
- Sample monitored application withBufferingApplicationStartup
Configuration Examples
application-oauth2.yml
Module Integration
Testing
mvn clean install
)Documentation
Includes example configurations for:
Closes #1195