spring security - Zuul + OAuth2 server in the same application -


i want build spring cloud oauth2 server (@enableauthorizationserver). memory saving purposes, want same application @enablezuulproxy application. when parts in right places, clients must access services via zuul, , if not authenticated, must redirected login page.

all examples found keep zuul , oauth server in different applications (i have 1 working set configured way working fine). when try 2 functions in 1 application, stops working @ moment annotate authserverapplication class @enableoauth2sso:

this not works, @ least application runs (shows "full authentication required access resource" page):

@springbootapplication @enablezuulproxy @enablediscoveryclient @enableresourceserver @restcontroller @sessionattributes("authorizationrequest") public class authserverapplication extends webmvcconfigureradapter { 

this one, not run:

@springbootapplication @enablezuulproxy @enablediscoveryclient @enableoauth2sso   // supposed enable sso client @enableresourceserver @restcontroller @sessionattributes("authorizationrequest") public class authserverapplication extends webmvcconfigureradapter { 

the latter configuration, @enableoauth2sso, makes application crash following error message:

method springsecurityfilterchain in org.springframework.security.config.annotation.web.configuration.websecurityconfiguration required bean of type 'org.springframework.boot.autoconfigure.security.oauth2.resource.userinforesttemplatefactory' not found. - bean method 'userinforesttemplatefactory' not loaded because @conditionalonmissingbean (types: org.springframework.security.oauth2.config.annotation.web.configuration.authorizationserverendpointsconfiguration; searchstrategy: all) found bean 'org.springframework.security.oauth2.config.annotation.web.configuration.authorizationserverendpointsconfiguration'  action:  consider revisiting conditions above or defining bean of type 'org.springframework.boot.autoconfigure.security.oauth2.resource.userinforesttemplatefactory' in configuration. 

before trying this, tried put zuul , eureka in the same application, spring security prevents eureka reached microservices.


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -