0Pricing
Spring Security 6 & JWT Authentication · レッスン

プロジェクトのセットアップと依存関係

新しいSpring Bootプロジェクトをセットアップし、安全な環境に必要なSpring Securityの依存関係を統合します。

「プロジェクトのセットアップと依存関係」はCoddyKit上の無料Spring Security 6 & JWT Authenticationレッスンです。 これはレッスン2/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはSpring Security 6 & JWT Authentication学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Spring Security 6 & JWT Authenticationコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

Ready for Secure Apps!

Let's get a real project ready. You'll spin up a Spring Boot app and pull in the dependencies that switch on Spring Security 6.

Creating a Spring Boot Project

Start fast with Spring Initializr at start.spring.io — a web wizard that generates your whole project structure and build files in seconds.

Initializr Basics

In Spring Initializr you pick the build (Maven), language (Java), a stable Boot version, and metadata like group and artifact. That defines your project skeleton.

What Are Dependencies?

Dependencies are external libraries your app pulls in for features it doesn't write itself — pre-built code you wire in instead of reinventing.

The Security Starter

One dependency unlocks it all: spring-boot-starter-security. This starter pulls in the core auth and authorization modules in a single line.

Web Application Needs

To serve HTTP, add spring-boot-starter-web. It bundles embedded Tomcat and Spring MVC so your app can handle web requests and API responses.

Maven: Your Project's Blueprint

With Maven, you declare every library in pom.xml — your project's blueprint inside a <dependencies> block that tells Maven what to fetch.

Adding Security to pom.xml

Here's how the two starters sit inside your pom.xml dependencies block. Initializr adds these automatically when you select them.

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    <!-- Other dependencies like spring-boot-starter-test... -->
</dependencies>

First Run: What Happens?

Run the app with the security starter added and Spring Security locks every endpoint instantly. Watch the console for its generated default password.

package com.coddykit.securitysetup;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class SecuritysetupApplication {

  public static void main(String[] args) {
    SpringApplication.run(SecuritysetupApplication.class, args);
    System.out.println("\n--- Application Started --- ");
    System.out.println("Check your console for a default password if you access the app.");
  }

}

Quick Check!

After adding spring-boot-starter-security to a new Spring Boot web project, what is the immediate default behavior when you try to access any endpoint in your browser?

Recap: Project Ready!

Recap: you scaffolded a project with Spring Initializr, added the web and security starters, and saw Boot hand you a login page and console password for free.

よくある質問

「プロジェクトのセットアップと依存関係」レッスンは無料ですか?

はい。「プロジェクトのセットアップと依存関係」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Spring Security 6 & JWT Authenticationコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Spring Security 6 & JWT Authenticationコースには全4レッスンが含まれています。

「プロジェクトのセットアップと依存関係」で何を学びますか?

新しいSpring Bootプロジェクトをセットアップし、安全な環境に必要なSpring Securityの依存関係を統合します。 ブラウザで直接実行するハンズオンコードでSpring Security 6 & JWT Authenticationを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Spring Security 6 & JWT Authenticationを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのSpring Security 6 & JWT Authenticationは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン2/4です。

「プロジェクトのセットアップと依存関係」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このSpring Security 6 & JWT Authenticationレッスンでコードを書いて実行できますか?

はい。すべてのSpring Security 6 & JWT Authenticationレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. Spring Security 6入門
  2. プロジェクトのセットアップと依存関係
  3. インメモリユーザー認証
  4. Spring Security Filter Chainを理解する
← Spring Security 6 & JWT Authenticationに戻る