com.sap.cloud.security.ams.spring.autoconfig.resourceserver.ResourceServerWebSecurityAutoConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-ams Show documentation
Show all versions of spring-ams Show documentation
Client Library for integrating Spring applications with SAP Authorization Management Service (AMS)
The newest version!
/************************************************************************
* © 2019-2023 SAP SE or an SAP affiliate company. All rights reserved. *
************************************************************************/
package com.sap.cloud.security.ams.spring.autoconfig.resourceserver;
import com.sap.cloud.security.ams.dcl.client.pdp.PolicyDecisionPoint;
import com.sap.cloud.security.ams.spring.handler.resourceserver.ResourceServerWebSecurityExpressionHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.lang.NonNull;
import org.springframework.security.access.expression.SecurityExpressionHandler;
import org.springframework.security.web.FilterInvocation;
@Configuration
@ConditionalOnClass(name = "org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken")
@ConditionalOnBean(PolicyDecisionPoint.class)
@ConditionalOnProperty(name = "com.sap.cloud.security.ams.auto", havingValue = "true", matchIfMissing = true)
@Deprecated(forRemoval = true)
public class ResourceServerWebSecurityAutoConfiguration {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Bean
SecurityExpressionHandler amsWebExpressionHandler(
@NonNull PolicyDecisionPoint policyDecisionPoint) {
logger.debug(
"auto-configures WebSecurityExpressionHandler for app using spring-security-oauth2-resource-server");
return ResourceServerWebSecurityExpressionHandler.getInstance(policyDecisionPoint);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy