Good day.
I'm developing a spring-boot service which runs under certain port, let's say hostname:8080 in server. Users access this service over apache proxy, url.com/application
Now apache is configured:
ProxyRequests Off
ProxyPreserveHost Off
ProxyPass /application http://hostname:8080
ProxyPassReverse /application http://hostname:8080
I use oauth2 for authentication and authentication happens in authserver.com
Application.yml:
oauth2:
client:
clientId: username
clientSecret: 123123
accessTokenUri: http://authserver.com/oauth/token
userAuthorizationUri: http://authserver.com/oauth/authorize
clientAuthenticationScheme: form
resource:
userInfoUri: http://authserver.com/oauth/user
preferTokenInfo: false
- I request url.com/application
- I get redirected to form based authentication authserver.com/oath/authorize?client_id=username&redirect_url=url.com/login&...
- Once authenticated I get redirected back to url.com/login which was given as GET parameter in previous step. This is resulted to 404.
How can I modify that redirect_url in Spring Boot config? It should be url.com/application/login.
pom.xml:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-ws</artifactId>
<version>1.3.0.M2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependecies>
Security config:
@EnableAutoConfiguration
@EnableGlobalMethodSecurity(prePostEnabled = true)
public static class WebSecurityConfig extends OAuth2SsoConfiguration {
@Override
public void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers("/health", "/status", "/ws", "/ws/*", "/mappings", "/beans")
.anonymous();
http.csrf().disable();
super.configure(http);
}
}
Using Spring Cloud Security 1.0.0.RC3