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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -