Annotation Interface AuthSchemeProfile
@Retention(RUNTIME)
@Target(TYPE)
@Conditional(com.emc.documentum.rest.security.profile.AuthSchemeCondition.class)
@EnableWebSecurity
@Configuration
public @interface AuthSchemeProfile
Enabling conditional Java web security configurations for classes extending from
AbstractWebSecurity
.
To make a security configuration workable only for specific authentication schemes, add the annotation on the
configuration class with one or more authentication scheme names. For instance,
@AuthSchemeProfile(schemes= {"oauth2", "openid-connect"}) @Configuration public class MyCustomWebSecurity extends AbstractWebSecurity { @Override protected AuthenticationProvider[] authenticationProviders() { return new AuthenticationProvider[0]{ new CustomAuthProvider() }; } @Override public AuthenticationEntryPoint entryPoint() { return new CustomEntryPoint(); } @Override protected void configureSecurityFilters(HttpSecurity http) throws Exception { http.addFilterBefore(new CustomAuthFilter(), BasicAuthenticationFilter.class); } }To make the annotated security configuration effective at runtime, the property value for 'rest.security.auth.mode' in classpath file 'rest-api-runtime.properties' must match the annotation schemes. For instance,
rest.security.auth.mode=oauth2
-
Required Element Summary
-
Element Details
-
schemes
String[] schemesSupported authentication schemes for the annotated security configuration.- Returns:
- authentication scheme names
-