Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <parent>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-parent</artifactId>
- <version>2.0.1.RELEASE</version>
- </parent>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <java.version>1.8</java.version>
- <start-class>restTeatroproyecto.RestTeatroApplication</start-class>
- </properties>
- <dependencies>
- <!-- https://mvnrepository.com/artifact/javax.mail/mail -->
- <dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- <version>1.4</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>5.0.5.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-batch</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-data-jpa</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-jdbc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-devtools</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>com.microsoft.sqlserver</groupId>
- <artifactId>mssql-jdbc</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-test</artifactId>
- <scope>test</scope>
- </dependency>
- <!-- <dependency> -->
- <!-- <groupId>org.springframework.boot</groupId> -->
- <!-- <artifactId>spring-boot-starter-data-jpa</artifactId> -->
- <!-- <exclusions> -->
- <!-- <exclusion> -->
- <!-- <groupId>org.hibernate</groupId> -->
- <!-- <artifactId>hibernate-entitymanager</artifactId> -->
- <!-- </exclusion> -->
- <!-- <exclusion> -->
- <!-- <groupId>org.hibernate</groupId> -->
- <!-- <artifactId>hibernate-core</artifactId> -->
- <!-- </exclusion> -->
- <!-- </exclusions> -->
- <!-- </dependency> -->
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- </dependency>
- <dependency>
- <groupId>io.jsonwebtoken</groupId>
- <artifactId>jjwt</artifactId>
- <version>0.9.0</version>
- </dependency>
- <!-- <dependency> -->
- <!-- <groupId>javax.json</groupId> -->
- <!-- <artifactId>javax.json-api</artifactId> -->
- <!-- <version>1.1.2</version> -->
- <!-- </dependency> -->
- <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-security -->
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-security</artifactId>
- <version>2.0.0.RELEASE</version>
- </dependency>
- <!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core -->
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-core</artifactId>
- <version>5.0.3.RELEASE</version>
- </dependency>
- <!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-web -->
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-web</artifactId>
- <version>5.0.3.RELEASE</version>
- </dependency>
- <!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-config -->
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-config</artifactId>
- <version>5.0.3.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.1</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.aggregate</groupId>
- <artifactId>jetty-all</artifactId>
- <version>9.2.13.v20150730</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-thymeleaf</artifactId>
- <version>1.4.0.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>io.jsonwebtoken</groupId>
- <artifactId>jjwt</artifactId>
- <version>0.9.0</version>
- </dependency>
- <dependency>
- <groupId>org.jsoup</groupId>
- <artifactId>jsoup</artifactId>
- <version>1.8.3</version>
- </dependency>
- <!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>2.8.2</version>
- </dependency>
- <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider -->
- <dependency>
- <groupId>com.fasterxml.jackson.jaxrs</groupId>
- <artifactId>jackson-jaxrs-json-provider</artifactId>
- <version>2.9.0</version>
- </dependency>
- <!-- https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports -->
- <dependency>
- <groupId>net.sf.jasperreports</groupId>
- <artifactId>jasperreports</artifactId>
- <version>6.1.0</version>
- </dependency>
- <!-- https://mvnrepository.com/artifact/net.sf.barcode4j/barcode4j -->
- <dependency>
- <groupId>net.sf.barcode4j</groupId>
- <artifactId>barcode4j</artifactId>
- <version>2.0</version>
- </dependency>
- <!-- https://mvnrepository.com/artifact/org.apache.xmlgraphics/batik-bridge -->
- <dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-bridge</artifactId>
- <version>1.6.1</version>
- </dependency>
- <!-- https://mvnrepository.com/artifact/xerces/xercesImpl -->
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>2.9.0</version>
- </dependency>
- <!-- POI for jasper reports demo -->
- <dependency>
- <groupId>org.apache.poi</groupId>
- <artifactId>poi</artifactId>
- <version>3.7</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-thymeleaf</artifactId>
- </dependency>
- <!-- marked the embedded servlet container as provided -->
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-tomcat</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-jetty</artifactId>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <version>1.4.2.RELEASE</version>
- <executions>
- <execution>
- <goals>
- <goal>repackage</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <packagingExcludes>WEB-INF/lib/websocket-*.jar</packagingExcludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- @Configuration
- @Order(99)
- public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
- @Autowired
- private IUsuarioService usuarioService;
- // @Autowired
- // public WebSecurityConfig() {
- // super(true);
- // }
- //
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.csrf().disable().authorizeRequests().antMatchers(HttpMethod.OPTIONS, "/**").permitAll()// allow CORS option
- // calls
- .antMatchers(HttpMethod.POST, "/api/login").permitAll().antMatchers(HttpMethod.POST, "/login")
- .permitAll().anyRequest().authenticated().and()
- // We filter the api/login requests
- .addFilterBefore(new JWTLoginFilter("/login", authenticationManager()),
- UsernamePasswordAuthenticationFilter.class)
- // And filter other requests to check the presence of JWT in header
- .addFilterBefore(new JWTAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class)
- .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
- }
- }
Add Comment
Please, Sign In to add comment