Skip to content

Latest commit

 

History

History

sso-client-spring-cloud-gateway

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

SSO Client behind Spring Cloud Gateway

Usage

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);
    }
}

Additional options

Set prefix path behind reverse proxy

spring:
  cloud:
    gateway:
      default-filters:
        - name: PrefixPath
          args:
            prefix: /proxy/app

Exclude JWT filter for some APIs

sso:
  client:
    gateway:
      filter:
        exclude: /test,/api

Developer mode

# 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