All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bidib.wizard.server.config.WebSocketSecurityConfig Maven / Gradle / Ivy

There is a newer version: 2.0.29
Show newest version
package org.bidib.wizard.server.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry;
import org.springframework.security.config.annotation.web.socket.AbstractSecurityWebSocketMessageBrokerConfigurer;

@Configuration(proxyBeanMethods = false)
public class WebSocketSecurityConfig extends AbstractSecurityWebSocketMessageBrokerConfigurer {

    @Override
    protected void configureInbound(MessageSecurityMetadataSourceRegistry messages) {
        messages
            .nullDestMatcher().permitAll().simpDestMatchers("/**").permitAll().simpDestMatchers("/user/queue/errors")
            .permitAll().simpDestMatchers("/admin/**").hasRole("ADMIN").anyMessage().authenticated();
    }

    @Override
    protected boolean sameOriginDisabled() {
        return true;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy