feat: add OAuth2 sample applications and configurations#4594
feat: add OAuth2 sample applications and configurations#4594myProjectsRavi wants to merge 2 commits intocodecentric:masterfrom
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:
|
erikpetzold
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
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@EnableAdminServerClient App (OAuth2 Resource Server):
OAuth2ResourceServerConfig- JWT-based resource server protecting actuator endpointsOAuth2ClientApplication- Sample monitored application withBufferingApplicationStartupConfiguration Examples
application-oauth2.ymlModule Integration
Testing
mvn clean install)Documentation
Includes example configurations for:
Closes #1195