Add dependency to project:
<dependency>
<groupId>ru.loolzaaa</groupId>
<artifactId>sso-client-spring-cloud-gateway</artifactId>
<version>0.1.0</version>
</dependency>
Define SSO Server mandatory properties:
sso:
client:
applicationName: example
entryPointUri: /login
entryPointAddress: ${SSO_ENTRYPOINT:http://localhost:9999}
Use @EnableSsoClientGateway
annotation for automatically creating necessary beans:
@EnableSsoClientGateway
@SpringBootApplication
public class GatewayApplication {
public static void main(String[] args) {
SpringApplication.run(GatewayApplication.class, args);
}
}
spring:
cloud:
gateway:
default-filters:
- name: PrefixPath
args:
prefix: /proxy/app
sso:
client:
gateway:
filter:
exclude: /test,/api
# Enabled: false - JWT mode
# Enabled: true - Noop mode with filter
# Enabled: only - Noop mode w/o filter (user data from frontend)
sso:
client:
noop-mode:
enabled: only
default-user:
login: admin
authorities: viewer,editor