mirror of
				https://github.com/Frooodle/Stirling-PDF.git
				synced 2025-11-01 01:21:18 +01:00 
			
		
		
		
	ee flag for saml
This commit is contained in:
		
							parent
							
								
									d20e8f7d54
								
							
						
					
					
						commit
						b4837df76c
					
				@ -96,6 +96,11 @@ public class SecurityConfiguration {
 | 
			
		||||
    @Qualifier("loginEnabled")
 | 
			
		||||
    public boolean loginEnabledValue;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    @Qualifier("runningEE")
 | 
			
		||||
    public boolean runningEE;
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    @Autowired ApplicationProperties applicationProperties;
 | 
			
		||||
 | 
			
		||||
    @Autowired private UserAuthenticationFilter userAuthenticationFilter;
 | 
			
		||||
@ -263,7 +268,7 @@ public class SecurityConfiguration {
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Handle SAML
 | 
			
		||||
            if (applicationProperties.getSecurity().isSaml2Activ()) {
 | 
			
		||||
            if (applicationProperties.getSecurity().isSaml2Activ() && runningEE) {
 | 
			
		||||
            	http.authenticationProvider(samlAuthenticationProvider())
 | 
			
		||||
                .saml2Login(saml2 -> {
 | 
			
		||||
					try {
 | 
			
		||||
@ -306,13 +311,17 @@ public class SecurityConfiguration {
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
    @Bean
 | 
			
		||||
    @ConditionalOnProperty(
 | 
			
		||||
            value = "security.oauth2.enabled",
 | 
			
		||||
            havingValue = "true",
 | 
			
		||||
            matchIfMissing = false)
 | 
			
		||||
    public AuthenticationProvider samlAuthenticationProvider() {
 | 
			
		||||
        OpenSaml4AuthenticationProvider provider = new OpenSaml4AuthenticationProvider();
 | 
			
		||||
        provider.setResponseAuthenticationConverter(
 | 
			
		||||
            new CustomSaml2ResponseAuthenticationConverter(userService));
 | 
			
		||||
        return provider;
 | 
			
		||||
    }
 | 
			
		||||
    // Client Registration Repository for OAUTH2 OIDC Login
 | 
			
		||||
 | 
			
		||||
    @Bean
 | 
			
		||||
    @ConditionalOnProperty(
 | 
			
		||||
            value = "security.oauth2.enabled",
 | 
			
		||||
 | 
			
		||||
@ -17,15 +17,18 @@ public class PdfMetadataService {
 | 
			
		||||
    private final ApplicationProperties applicationProperties;
 | 
			
		||||
    private final String stirlingPDFLabel;
 | 
			
		||||
    private final UserServiceInterface userService;
 | 
			
		||||
    private final boolean runningEE;
 | 
			
		||||
    
 | 
			
		||||
    @Autowired
 | 
			
		||||
    public PdfMetadataService(
 | 
			
		||||
            ApplicationProperties applicationProperties,
 | 
			
		||||
            @Qualifier("StirlingPDFLabel") String stirlingPDFLabel,
 | 
			
		||||
            @Qualifier("runningEE") boolean runningEE,
 | 
			
		||||
            @Autowired(required = false) UserServiceInterface userService) {
 | 
			
		||||
        this.applicationProperties = applicationProperties;
 | 
			
		||||
        this.stirlingPDFLabel = stirlingPDFLabel;
 | 
			
		||||
        this.userService = userService;
 | 
			
		||||
        this.runningEE = runningEE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public PdfMetadata extractMetadataFromPdf(PDDocument pdf) {
 | 
			
		||||
@ -64,7 +67,7 @@ public class PdfMetadataService {
 | 
			
		||||
        if (applicationProperties
 | 
			
		||||
                .getEnterpriseEdition()
 | 
			
		||||
                .getCustomMetadata()
 | 
			
		||||
                .isAutoUpdateMetadata()) {
 | 
			
		||||
                .isAutoUpdateMetadata() && runningEE) {
 | 
			
		||||
 | 
			
		||||
            creator = applicationProperties.getEnterpriseEdition().getCustomMetadata().getCreator();
 | 
			
		||||
            pdf.getDocumentInformation().setProducer(stirlingPDFLabel);
 | 
			
		||||
@ -86,7 +89,7 @@ public class PdfMetadataService {
 | 
			
		||||
        if (applicationProperties
 | 
			
		||||
                .getEnterpriseEdition()
 | 
			
		||||
                .getCustomMetadata()
 | 
			
		||||
                .isAutoUpdateMetadata()) {
 | 
			
		||||
                .isAutoUpdateMetadata() && runningEE) {
 | 
			
		||||
            author = applicationProperties.getEnterpriseEdition().getCustomMetadata().getAuthor();
 | 
			
		||||
 | 
			
		||||
            if (userService != null) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user