[JAVA] [Frühlingssicherheit] Frühlingssicherheit auf GAE (SE)

Einführung

Beachten Sie, dass Spring Security auf GAE (SE) ausgeführt wurde.

Umgebung

eclipse maven

volle pom.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project
	xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

	<modelVersion>4.0.0</modelVersion>
	<packaging>war</packaging>
	<version>0.1.0-SNAPSHOT</version>

	<groupId>trial-nino</groupId>
	<artifactId>spring-mvc01-springsecurity-gae-se</artifactId>

	<prerequisites>
		<maven>3.5</maven>
	</prerequisites>

	<properties>
		<appengine.maven.plugin.version>1.3.2</appengine.maven.plugin.version>
		<appengine.api.sdk.version>1.9.71</appengine.api.sdk.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
	</properties>

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.1.1.RELEASE</version>
		<relativePath />
	</parent>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>com.google.cloud</groupId>
				<artifactId>google-cloud-bom</artifactId>
				<version>0.78.0-alpha</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>

		<!-- Compile/runtime dependencies -->
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<!-- version>3.1.0</version -->
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet.jsp</groupId>
			<artifactId>javax.servlet.jsp-api</artifactId>
			<version>2.3.1</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>jstl</groupId>
			<artifactId>jstl</artifactId>
			<version>1.2</version>
		</dependency>
		<dependency>
			<groupId>com.google.appengine</groupId>
			<artifactId>appengine-api-1.0-sdk</artifactId>
			<!-- version>1.9.71</version -->
		</dependency>

		<!-- spring boot -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.springframework.boot</groupId>
					<artifactId>spring-boot-starter-tomcat</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-thymeleaf</artifactId>
		</dependency>
		<dependency>
			<groupId>nz.net.ultraq.thymeleaf</groupId>
			<artifactId>thymeleaf-layout-dialect</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-security</artifactId>
		</dependency>

		<!-- java library -->
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<!-- version>1.18.4</version -->
			<scope>provided</scope>
		</dependency>

		<!-- logger -->
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<!-- version>1.2.3</version -->
		</dependency>

		<!-- Test Dependencies -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<!-- version>4.12</version -->
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<!-- for hot reload of the web application -->
		<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
		<testOutputDirectory>${project.build.directory}/test-classes</testOutputDirectory>
		<resources>
			<resource>
				<directory>${project.basedir}/src/main/resources</directory>
			</resource>
		</resources>
		<testResources>
			<testResource>
				<directory>src/test/resources</directory>
				<includes>
					<include>**/*.properties</include>
				</includes>
			</testResource>
		</testResources>


		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>versions-maven-plugin</artifactId>
				<!-- version>2.3</version -->
				<executions>
					<execution>
						<phase>compile</phase>
						<goals>
							<goal>display-dependency-updates</goal>
							<goal>display-plugin-updates</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<configuration>
					<webResources>
						<!-- in order to interpolate version from pom into appengine-web.xml -->
						<resource>
							<directory>${basedir}/src/main/webapp/WEB-INF</directory>
							<filtering>true</filtering>
							<targetPath>WEB-INF</targetPath>
						</resource>
					</webResources>
				</configuration>
			</plugin>

			<plugin>
				<groupId>com.google.cloud.tools</groupId>
				<artifactId>appengine-maven-plugin</artifactId>
				<version>${appengine.maven.plugin.version}</version>
				<configuration>
					<deploy.promote>true</deploy.promote>
					<deploy.stopPreviousVersion>true</deploy.stopPreviousVersion>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>

		</plugins>
	</build>
</project>

Verfahren

Andere

Wenn Sie Spring Security nicht verwenden Statische Dateien (CSS, Javascript usw.) konnten nur gelesen werden, wenn ein Verzeichnis direkt unter der Webanwendung erstellt wurde. Wenn Sie SpringSecurity verwenden und in SecurityConfig angeben, können Sie statische Dateien unter WEB-INF lesen.

das ist alles

Recommended Posts

[Frühlingssicherheit] Frühlingssicherheit auf GAE (SE)
gae + frühlingsstiefel
Informationen zur Spring Security-Authentifizierung
Spring Security erhöht 403 verboten
Spring Boot unter Microsoft Azure
Spring Security-Nutzungsnotiz CSRF
Beim Übergeben von Java Gold SE 8
Spring Security-Nutzungsnotiz Run-As
Sicherheit der Verwendungsnotizmethode für Spring Security
Spring Security-Nutzungsnotiz Remember-Me
Anmeldefunktion mit Spring Security
Versuchen Sie es mit Spring Boot Security
Versuchen Sie Spring Boot auf dem Mac
Spring Security-Nutzungsnotiz CORS
Spring Security-Verwendungsnotiztest
Spring Security-Nutzungsnotiz Authentifizierung / Autorisierung
gRPC auf Spring Boot mit grpc-spring-boot-Starter
Implementierte Authentifizierungsfunktion mit Spring Security ③
Spring Boot Tutorial Verwenden der Spring Security-Authentifizierung
Antwortheader für die Verwendung von Spring Security
Implementierte Authentifizierungsfunktion mit Spring Security ①
Erfahren Sie mehr über die Architektur der Spring Security-Authentifizierungsverarbeitung
Sitzungsverwaltung für Spring Security-Nutzungsnotizen
Versuchen Sie, Spring Boot auf Kubernetes auszuführen
Spring Security-Nutzungsnotiz Basic / Mechanismus
Zertifizierung / Autorisierung mit Spring Security & Thymeleaf