Merge pull request #4199 from guigarage/spring-security-annotation
Easy Spring security annotation
This commit is contained in:
commit
9edb5b53c0
1 changed files with 25 additions and 0 deletions
|
@ -0,0 +1,25 @@
|
||||||
|
package org.keycloak.adapters.springsecurity;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||||
|
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
import static java.lang.annotation.ElementType.TYPE;
|
||||||
|
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add this annotation to a class that extends {@code KeycloakWebSecurityConfigurerAdapter} to provide
|
||||||
|
* a keycloak based Spring security configuration.
|
||||||
|
*
|
||||||
|
* @author Hendrik Ebbers
|
||||||
|
*/
|
||||||
|
@Retention(value = RUNTIME)
|
||||||
|
@Target(value = { TYPE })
|
||||||
|
@Configuration
|
||||||
|
@ComponentScan(basePackageClasses = KeycloakSecurityComponents.class)
|
||||||
|
@EnableWebSecurity
|
||||||
|
public @interface KeycloakConfiguration {
|
||||||
|
}
|
Loading…
Reference in a new issue