Introducing Basic Authentication on Heroku [Spring Framework]

Deliverables

スクリーンショット 2020-06-28 17.22.18.png

Preparation

Heroku Official Documentation

Prepare for your Heroku deployment according to the official Heroku documentation above.

pom.xml


・ ・ ・
<packaging>war</packaging>
・ ・ ・
<dependencies>
・ ・ ・
</dependencies>
<build>
    ...
    <plugins>
        ...
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals><goal>copy</goal></goals>
                    <configuration>
                        <artifactItems>
                            <artifactItem>
                                <groupId>com.heroku</groupId>
                                <artifactId>webapp-runner</artifactId>
                                <version>9.0.30.0</version>
                                <destFileName>webapp-runner.jar</destFileName>
                            </artifactItem>
                        </artifactItems>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Procfile


web: java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port $PORT --enable-basic-auth --basic-auth-user [username] --basic-auth-pw [password] target/*.war

Recommended Posts

Introducing Basic Authentication on Heroku [Spring Framework]
Introducing Bugsnag on Heroku
I can't log in on Heroku when I introduce Basic authentication.
Use Basic Authentication with Spring Boot
Achieve BASIC authentication with Spring Boot + Spring Security
Introducing New Relic to Rails apps on Heroku
Introducing Rspec, a Ruby on Rails test framework
Execute arbitrary processing after Basic authentication with Spring boot.
Introducing New Relic to Java apps running on Heroku
[Spring Framework] Configuration split
Spring Framework multilingual support
Spring Boot + Heroku Postgres
About Spring Security authentication
1. Start Spring framework from 1
Spring Framework Summary-About DI
Yay! I'm on Heroku!
Use Corretto 11 on Heroku
Error resolution on Heroku
Introducing Spring Boot2, a Java framework for web development (for beginners)