> ## Documentation Index
> Fetch the complete documentation index at: https://translations.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Java Spring Boot

> Okta Spring Boot Starter を使用して、Spring Boot の Web アプリケーションに Auth0 ログインを追加します。

export const HowToSchema = () => <script type="application/ld+json">
    {'{"@context":"https://schema.org","@type":"HowTo"}'}
  </script>;

export const AuthCodeGroup = ({children, dropdown}) => {
  const [processedChildren, setProcessedChildren] = useState(children);
  useEffect(() => {
    let unsubscribe = null;
    function init() {
      unsubscribe = window.autorun(() => {
        const processChildren = node => {
          if (typeof node === "string") {
            let processedNode = node;
            for (const [key, value] of window.rootStore.variableStore.values.entries()) {
              const escapedKey = key.replaceAll(/[.*+?^${}()|[\]\\]/g, (String.raw)`\$&`);
              processedNode = processedNode.replaceAll(new RegExp(escapedKey, "g"), value);
            }
            return processedNode;
          } else if (Array.isArray(node)) {
            return node.map(processChildren);
          } else if (node && node.props && node.props.children) {
            return {
              ...node,
              props: {
                ...node.props,
                children: processChildren(node.props.children)
              }
            };
          }
          return node;
        };
        setProcessedChildren(processChildren(children));
      });
    }
    if (window.rootStore) {
      init();
    } else {
      window.addEventListener("adu:storeReady", init);
    }
    return () => {
      window.removeEventListener("adu:storeReady", init);
      unsubscribe?.();
    };
  }, [children]);
  return <CodeGroup dropdown={dropdown}>{processedChildren}</CodeGroup>;
};

<HowToSchema />

<Note>
  **前提条件:**

  * JDK 17 以上 ([ダウンロード](https://adoptium.net/))
  * Maven 3.6 以上、または Gradle 7 以上 ([Maven](https://maven.apache.org/download.cgi) | [Gradle](https://gradle.org/install/))
  * IDE (IntelliJ IDEA、Eclipse、または VS Code を推奨)

  **Java バージョンの互換性:** Spring Boot 3.x 以降および Okta Spring Boot Starter 3.x では、Java 17 以降が必要です。
</Note>

<div id="get-started">
  ## はじめに
</div>

このクイックスタートでは、Spring Boot の Web アプリケーションに Auth0 のログインを追加する方法を説明します。Okta Spring Boot Starter を使用して、ログイン、ログアウト、保護されたプロフィールページを備えた安全な Web アプリケーションを構築します。この Starter は、Spring Security の OAuth2 ログインサポートを自動的に設定します。

<Steps>
  <Step title="新規プロジェクトを作成する" stepNumber={1}>
    必要な依存関係を含む Spring Boot プロジェクトを作成します。

    <Tabs>
      <Tab title="Spring Initializr を使用する">
        ```bash theme={null}
        curl -L https://start.spring.io/starter.zip \
            -d dependencies=web,security,thymeleaf \
            -d javaVersion=17 \
            -d name=auth0-webapp \
            -d artifactId=auth0-webapp \
            -d packageName=com.auth0.example \
            -o auth0-webapp.zip

        mkdir auth0-webapp && unzip auth0-webapp.zip -d auth0-webapp && cd auth0-webapp
        ```
      </Tab>

      <Tab title="または Maven で手動で作成する">
        ```bash theme={null}
        mvn archetype:generate \
            -DgroupId=com.auth0 \
            -DartifactId=auth0-webapp \
            -DarchetypeArtifactId=maven-archetype-quickstart \
            -DinteractiveMode=false

        cd auth0-webapp
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Okta Spring Boot Starterを追加する" stepNumber={2}>
    Okta Spring Boot Starter の依存関係をプロジェクトに追加します。これにより、Auth0/Okta 向けの自動構成を備えた Spring Security OAuth2 ログインサポートが組み込まれます。

    <Tabs>
      <Tab title="Maven (pom.xml)">
        ```xml theme={null}
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.thymeleaf.extras</groupId>
            <artifactId>thymeleaf-extras-springsecurity6</artifactId>
        </dependency>
        <dependency>
            <groupId>com.okta.spring</groupId>
            <artifactId>okta-spring-boot-starter</artifactId>
            <version>3.1.0</version>
        </dependency>
        ```
      </Tab>

      <Tab title="Gradle (build.gradle)">
        ```gradle theme={null}
        dependencies {
            implementation 'org.springframework.boot:spring-boot-starter-security'
            implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
            implementation 'org.springframework.boot:spring-boot-starter-web'
            implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6'
            implementation 'com.okta.spring:okta-spring-boot-starter:3.1.0'
            testImplementation 'org.springframework.boot:spring-boot-starter-test'
            testImplementation 'org.springframework.security:spring-security-test'
            testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
        }
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Auth0 を設定する" stepNumber={3}>
    Auth0テナントでRegular Web Applicationを作成し、プロジェクトに設定を追加してください。

    CLIコマンドを実行して自動的に行う方法と、Dashboardから手動で行う方法のいずれかを選択できます。

    <Tabs>
      <Tab title="CLI">
        Auth0 アプリケーションを作成して `application.yml` ファイルを更新するには、プロジェクトのルートディレクトリで次のシェルコマンドを実行します。

        <Tabs>
          <Tab title="Mac/Linux">
            ```bash expandable theme={null}
            AUTH0_APP_NAME="My Spring Boot Webapp" && \
            brew tap auth0/auth0-cli && \
            brew install auth0 && \
            auth0 login --no-input && \
            auth0 apps create -n "${AUTH0_APP_NAME}" -t regular \
                --callbacks "http://localhost:3000/login/oauth2/code/okta" \
                --logout-urls "http://localhost:3000/" \
                --json > auth0-app-details.json && \
            DOMAIN=$(auth0 tenants list --json | jq -r '.[] | select(.active == true) | .name') && \
            CLIENT_ID=$(jq -r '.client_id' auth0-app-details.json) && \
            CLIENT_SECRET=$(jq -r '.client_secret' auth0-app-details.json) && \
            mkdir -p src/main/resources && \
            printf 'server:\n  port: 3000\n\nokta:\n  oauth2:\n    issuer: https://%s/\n    client-id: %s\n    client-secret: %s\n' "$DOMAIN" "$CLIENT_ID" "$CLIENT_SECRET" > src/main/resources/application.yml && \
            rm auth0-app-details.json && \
            echo "✅ application.yml created with your Auth0 app details:" && \
            cat src/main/resources/application.yml
            ```
          </Tab>

          <Tab title="Windows (PowerShell)">
            ```powershell expandable theme={null}
            $AppName = "My Spring Boot Webapp"
            $latestRelease = Invoke-RestMethod -Uri "https://api.github.com/repos/auth0/auth0-cli/releases/latest"
            $latestVersion = $latestRelease.tag_name
            $version = $latestVersion -replace "^v"
            Invoke-WebRequest -Uri "https://github.com/auth0/auth0-cli/releases/download/${latestVersion}/auth0-cli_${version}_Windows_x86_64.zip" -OutFile ".\auth0.zip"
            Expand-Archive ".\auth0.zip" .\
            [System.Environment]::SetEnvironmentVariable('PATH', $Env:PATH + ";${pwd}")
            auth0 login --no-input
            auth0 apps create -n "$AppName" -t regular `
                --callbacks "http://localhost:3000/login/oauth2/code/okta" `
                --logout-urls "http://localhost:3000/" `
                --json | Set-Content -Path auth0-app-details.json
            $AppDetails = Get-Content -Raw auth0-app-details.json | ConvertFrom-Json
            $Domain = (auth0 tenants list --json | ConvertFrom-Json | Where-Object { $_.active -eq $true }).name
            $ClientId = $AppDetails.client_id
            $ClientSecret = $AppDetails.client_secret
            New-Item -ItemType Directory -Force -Path "src\main\resources"
            @"
            server:
              port: 3000

            okta:
              oauth2:
                issuer: "https://$Domain/"
                client-id: "$ClientId"
                client-secret: "$ClientSecret"
            "@ | Set-Content "src\main\resources\application.yml"
            Remove-Item auth0-app-details.json
            Write-Output "✅ application.yml created with your Auth0 app details:"
            Get-Content "src\main\resources\application.yml"
            ```
          </Tab>
        </Tabs>
      </Tab>

      <Tab title="ダッシュボード">
        開始する前に、`src/main/resources/application.yml` ファイルに Auth0 の設定を追加してください。

        ```yaml src/main/resources/application.yml expandable theme={null}
        server:
          port: 3000

        okta:
          oauth2:
            issuer: "https://YOUR_AUTH0_DOMAIN/"
            client-id: "YOUR_CLIENT_ID"
            client-secret: "YOUR_CLIENT_SECRET"
        ```

        1. [Auth0 Dashboard](https://manage.auth0.com) → **Applications** → **Applications** に移動します。
        2. **Create Application** を選択します。
        3. 名前 (例: "My Spring Boot Webapp") を入力し、**Regular Web Applications** を選択します。
        4. **Create** を選択します。
        5. **Application Settings** タブに移動し、次のように設定します。
           * **Allowed Callback URLs**: `http://localhost:3000/login/oauth2/code/okta`
           * **Allowed Logout URLs**: `http://localhost:3000/`
        6. **Application Settings** タブから **ドメイン**、**クライアントID**、**クライアントシークレット** をコピーします。
        7. `application.yml` 内のプレースホルダー値を置き換えます。

        <Info>
          **Callback URL** は厳密に一致する必要があります。Spring Security の OAuth2 ログインでは、既定で `/login/oauth2/code/okta` パスが使用されます。

          **Issuer** には `https://` と末尾の `/` を含める必要があります。ドメインとリージョンのみを使用してください。例: `https://dev-abc123.us.auth0.com/`。
        </Info>
      </Tab>
    </Tabs>
  </Step>

  <Step title="認証を設定" stepNumber={4}>
    OAuth2 ログインを有効にし、Auth0 からのログアウトを処理するセキュリティ設定を作成します。認証されていないユーザーは自動的に Auth0 のログインページにリダイレクトされます。

    ```java lines expandable theme={null}
    // src/main/java/com/auth0/example/SecurityConfig.java

    package com.auth0.example;

    import org.springframework.beans.factory.annotation.Value;
    import org.springframework.context.annotation.Bean;
    import org.springframework.context.annotation.Configuration;
    import org.springframework.security.config.annotation.web.builders.HttpSecurity;
    import org.springframework.security.web.SecurityFilterChain;
    import org.springframework.security.web.authentication.logout.LogoutHandler;
    import org.springframework.web.servlet.support.ServletUriComponentsBuilder;

    import java.io.IOException;

    import static org.springframework.security.config.Customizer.withDefaults;

    @Configuration
    public class SecurityConfig {

        @Value("${okta.oauth2.issuer}")
        private String issuer;
        @Value("${okta.oauth2.client-id}")
        private String clientId;

        @Bean
        public SecurityFilterChain configure(HttpSecurity http) throws Exception {
            http
                .authorizeHttpRequests(authorize -> authorize
                    .requestMatchers("/", "/images/**").permitAll()
                    .anyRequest().authenticated()
                )
                .oauth2Login(withDefaults())
                .logout(logout -> logout
                    .addLogoutHandler(logoutHandler()));
            return http.build();
        }

        private LogoutHandler logoutHandler() {
            return (request, response, authentication) -> {
                try {
                    String baseUrl = ServletUriComponentsBuilder.fromCurrentContextPath().build().toUriString();
                    response.sendRedirect(issuer + "v2/logout?client_id=" + clientId + "&returnTo=" + baseUrl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            };
        }
    }
    ```
  </Step>

  <Step title="コントローラーとビューを作成する" stepNumber={5}>
    ホームページとプロフィールページ用のコントローラーと Thymeleaf テンプレートを作成します。

    <AuthCodeGroup>
      ```java src/main/java/com/auth0/example/HomeController.java expandable lines theme={null}
      package com.auth0.example;

      import org.springframework.security.core.annotation.AuthenticationPrincipal;
      import org.springframework.security.oauth2.core.oidc.user.OidcUser;
      import org.springframework.stereotype.Controller;
      import org.springframework.ui.Model;
      import org.springframework.web.bind.annotation.GetMapping;

      @Controller
      public class HomeController {

          @GetMapping("/")
          public String home(Model model, @AuthenticationPrincipal OidcUser principal) {
              if (principal != null) {
                  model.addAttribute("profile", principal.getClaims());
              }
              return "index";
          }
      }
      ```

      ```java src/main/java/com/auth0/example/ProfileController.java expandable lines theme={null}
      package com.auth0.example;

      import com.fasterxml.jackson.core.JsonProcessingException;
      import com.fasterxml.jackson.databind.ObjectMapper;
      import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
      import org.springframework.security.core.annotation.AuthenticationPrincipal;
      import org.springframework.security.oauth2.core.oidc.user.OidcUser;
      import org.springframework.stereotype.Controller;
      import org.springframework.ui.Model;
      import org.springframework.web.bind.annotation.GetMapping;

      import java.util.Map;

      @Controller
      public class ProfileController {

          private final static ObjectMapper mapper = new ObjectMapper().registerModule(new JavaTimeModule());

          @GetMapping("/profile")
          public String profile(Model model, @AuthenticationPrincipal OidcUser oidcUser) {
              model.addAttribute("profile", oidcUser.getClaims());
              model.addAttribute("profileJson", claimsToJson(oidcUser.getClaims()));
              return "profile";
          }

          private String claimsToJson(Map<String, Object> claims) {
              try {
                  return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(claims);
              } catch (JsonProcessingException jpe) {
                  return "Error parsing claims to JSON.";
              }
          }
      }
      ```

      ```html src/main/resources/templates/index.html expandable lines theme={null}
      <!DOCTYPE html>
      <html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
      <head>
          <meta charset="UTF-8">
          <title>Auth0 Spring Boot Login</title>
      </head>
      <body>
          <h1>Auth0 Spring Boot Login Sample</h1>

          <div sec:authorize="!isAuthenticated()">
              <p>You are not logged in.</p>
              <a href="/oauth2/authorization/okta">Login</a>
          </div>

          <div sec:authorize="isAuthenticated()">
              <p>Welcome, <span sec:authentication="name">User</span>!</p>
              <ul>
                  <li><a href="/profile">View Profile</a></li>
                  <li>
                      <form th:action="@{/logout}" method="post" style="display:inline;">
                          <button type="submit">Logout</button>
                      </form>
                  </li>
              </ul>
          </div>
      </body>
      </html>
      ```

      ```html src/main/resources/templates/profile.html expandable lines theme={null}
      <!DOCTYPE html>
      <html lang="en" xmlns:th="http://www.thymeleaf.org">
      <head>
          <meta charset="UTF-8">
          <title>User Profile</title>
      </head>
      <body>
          <h1>User Profile</h1>
          <a href="/">Home</a>

          <div th:if="${profile}">
              <img th:if="${profile['picture']}" th:src="${profile['picture']}" width="64" height="64" alt="Profile picture" />
              <h2 th:text="${profile['name']}">Name</h2>
              <p th:text="${profile['email']}">Email</p>
          </div>

          <h3>All Claims</h3>
          <pre th:text="${profileJson}">Claims JSON</pre>

          <form th:action="@{/logout}" method="post">
              <button type="submit">Logout</button>
          </form>
      </body>
      </html>
      ```
    </AuthCodeGroup>
  </Step>

  <Step title="アプリケーションを実行する" stepNumber={6}>
    Maven または Gradle のラッパーを使用して、アプリケーションを起動します。

    <Tabs>
      <Tab title="Maven">
        ```bash theme={null}
        ./mvnw spring-boot:run
        ```
      </Tab>

      <Tab title="Gradle">
        ```bash theme={null}
        ./gradlew bootRun
        ```
      </Tab>
    </Tabs>

    アプリケーションは `http://localhost:3000` で実行中です。Auth0 のログインフローを開始するには、`http://localhost:3000/profile` にアクセスします。
  </Step>
</Steps>

<Check>
  これで、Auth0 ログインを備えた完全に動作する Spring Boot Web アプリケーションが [localhost](http://localhost:3000/) で実行されているはずです。ホームページは公開されており、`/profile` にアクセスすると、未認証のユーザーは Auth0 のログインページにリダイレクトされます。
</Check>

***

<div id="advanced-usage">
  ## 高度な使い方
</div>

<Accordion title="ユーザープロファイルクレームへのアクセス">
  `@AuthenticationPrincipal OidcUser` パラメーターを使用すると、IDトークンのすべてのクレームにアクセスできます。すべてのクレームを取得するには `getClaims()` を使用し、特定のクレームを取得するには個別の getter メソッドを使用します。

  ```java theme={null}
  @GetMapping("/profile")
  public String profile(Model model, @AuthenticationPrincipal OidcUser oidcUser) {
      model.addAttribute("name", oidcUser.getFullName());
      model.addAttribute("email", oidcUser.getEmail());
      model.addAttribute("picture", oidcUser.getPicture());
      model.addAttribute("sub", oidcUser.getSubject());
      model.addAttribute("allClaims", oidcUser.getClaims());
      return "profile";
  }
  ```
</Accordion>

<Accordion title="ロールベースアクセス制御">
  Auth0 のロールに基づいてページへのアクセスを制限できます。まず、Auth0のActionを使用して IDトークンにロールを追加し、その後セキュリティ設定で `hasAuthority()` を使用します。

  ### トークンにロールを追加する

  1. [Auth0 Dashboard](https://manage.auth0.com) → **Actions** → **Flows** → **Login** に移動します。
  2. IDトークンにカスタムクレームとしてロールを追加するカスタム Action を作成します。

  ```javascript theme={null}
  exports.onExecutePostLogin = async (event, api) => {
    const namespace = "https://my-app.example.com";
    if (event.authorization) {
      api.idToken.setCustomClaim(`${namespace}/roles`, event.authorization.roles);
    }
  };
  ```

  ### 認可を設定する

  エンドポイントで特定のロールを必須にするよう、`SecurityConfig` を更新します。

  ```java expandable theme={null}
  @Bean
  public SecurityFilterChain configure(HttpSecurity http) throws Exception {
      http
          .authorizeHttpRequests(authorize -> authorize
              .requestMatchers("/", "/images/**").permitAll()
              .requestMatchers("/admin/**").hasAuthority("ROLE_admin")
              .anyRequest().authenticated()
          )
          .oauth2Login(withDefaults())
          .logout(logout -> logout
              .addLogoutHandler(logoutHandler()));
      return http.build();
  }
  ```
</Accordion>

<Accordion title="カスタム権限のマッピング">
  Okta Starter は、`AuthoritiesProvider` インターフェイスを介したカスタム権限マッピングをサポートしています。ユーザー属性や外部データソースに基づいてカスタム `GrantedAuthority` オブジェクトを追加するには、Bean を登録します。

  ```java expandable theme={null}
  package com.auth0.example;

  import com.okta.spring.boot.oauth.AuthoritiesProvider;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.security.core.GrantedAuthority;
  import org.springframework.security.core.authority.SimpleGrantedAuthority;

  import java.util.HashSet;
  import java.util.List;
  import java.util.Set;

  @Configuration
  public class AuthoritiesConfig {

      @Bean
      AuthoritiesProvider customAuthoritiesProvider() {
          return (user, userRequest) -> {
              Set<GrantedAuthority> authorities = new HashSet<>();

              // カスタム roles クレームを Spring Security の権限にマッピングする
              Object roles = user.getAttribute("https://my-app.example.com/roles");
              if (roles instanceof List<?> roleList) {
                  roleList.forEach(role ->
                      authorities.add(new SimpleGrantedAuthority("ROLE_" + role))
                  );
              }

              return authorities;
          };
      }
  }
  ```
</Accordion>

***

<div id="common-issues">
  ## よくある問題
</div>

<AccordionGroup>
  <Accordion title="ログインへのリダイレクトに失敗する - コールバック URL が無効">
    ログインを選択すると、Auth0 にコールバック URL の不一致に関するエラーが表示されます。

    Auth0 アプリケーションの **Allowed Callback URLs** は、Spring Security で使用されるコールバック URL と完全に一致している必要があります。デフォルトは `http://localhost:3000/login/oauth2/code/okta` です。

    1. [Auth0 Dashboard](https://manage.auth0.com) → **Applications** → Your App → **Settings** に移動します。
    2. **Allowed Callback URLs** に `http://localhost:3000/login/oauth2/code/okta` を追加します。
    3. **Save Changes** を選択します。
  </Accordion>

  <Accordion title="起動時に issuer が無効">
    アプリケーションの起動に失敗するか、issuer の不一致によりログインに失敗します。

    `okta.oauth2.issuer` には、`https://` と末尾の `/` を含む完全な Auth0 テナント URL を指定する必要があります。

    ```yaml theme={null}
    # ❌ 誤り - https:// または末尾のスラッシュがない
    okta:
      oauth2:
        issuer: "dev-abc123.us.auth0.com"

    # ✅ 正しい - 末尾のスラッシュを含む完全な URL
    okta:
      oauth2:
        issuer: "https://dev-abc123.us.auth0.com/"
    ```
  </Accordion>

  <Accordion title="起動時に OIDC ディスカバリーに失敗する">
    `/.well-known/openid-configuration` の取得時に接続エラーが発生し、アプリケーションの起動に失敗します。

    Okta Spring Boot Starter は、起動時に issuer URL から OpenID Connect ディスカバリードキュメントを取得します。issuer URL が正しく、ネットワークから到達可能であることを確認してください。社内ファイアウォールの内側にある場合は、プロキシを設定してください。

    ```yaml theme={null}
    okta:
      oauth2:
        issuer: "https://dev-abc123.us.auth0.com/"
        proxy:
          host: "proxy.example.com"
          port: 8080
    ```
  </Accordion>

  <Accordion title="設定値が見つからない">
    アプリケーションは起動しますが、設定プロパティが読み込まれていないため、ログインに失敗します。

    `application.yml` で、`okta.oauth2` 名前空間の下に正しい YAML のインデントが使われていることを確認してください。

    ```yaml theme={null}
    # ❌ 誤り - フラットな構造で、ネストされていない
    okta.oauth2.issuer: "https://dev-abc123.us.auth0.com/"

    # ✅ 正しい - 適切にネストされた YAML
    okta:
      oauth2:
        issuer: "https://dev-abc123.us.auth0.com/"
        client-id: "YOUR_CLIENT_ID"
        client-secret: "YOUR_CLIENT_SECRET"
    ```
  </Accordion>

  <Accordion title="ログアウトしても Auth0 セッションがクリアされない">
    ログアウトを選択した後、Auth0 のログインページが表示されず、ユーザーはすぐに再ログインした状態になります。

    `SecurityConfig` に、Auth0 の `/v2/logout` エンドポイントへリダイレクトするカスタム `LogoutHandler` が含まれていることを確認してください。また、Auth0 アプリケーション設定の **Allowed Logout URLs** に `http://localhost:3000/` が含まれていることも確認してください。
  </Accordion>
</AccordionGroup>

***

<div id="additional-resources">
  ## 参考資料
</div>

<CardGroup cols={3}>
  <Card title="SDKドキュメント" icon="book" href="https://github.com/okta/okta-spring-boot">
    SDKの完全なドキュメント、ソースコード、リリースノート
  </Card>

  <Card title="Auth0ドキュメント" icon="file-lines" href="https://auth0.com/docs">
    Spring Bootアプリケーション向けのAuth0公式ドキュメント
  </Card>

  <Card title="Spring Securityリファレンス" icon="shield" href="https://docs.spring.io/spring-security/reference/servlet/oauth2/login.html">
    Spring Security OAuth2 Loginのドキュメント
  </Card>

  <Card title="設定リファレンス" icon="gear" href="https://github.com/okta/okta-spring-boot#configuration-reference">
    使用可能なすべてのokta.oauth2.\*設定プロパティ
  </Card>

  <Card title="Auth0 Dashboard" icon="browser" href="https://manage.auth0.com/">
    Auth0のAPIとアプリケーションを管理します
  </Card>

  <Card title="コミュニティフォーラム" icon="comments" href="https://community.auth0.com/">
    Auth0コミュニティからサポートを受ける
  </Card>
</CardGroup>

***

<div id="sample-application">
  ## サンプルアプリケーション
</div>

Auth0 を使用したログイン、プロフィール表示、ログアウトを実装した完全なサンプルアプリケーションは、Auth0 サンプルリポジトリで公開されています。

<Card title="MVC ログインサンプル" icon="github" href="https://github.com/auth0-samples/auth0-spring-boot-login-samples/tree/master/mvc-login">
  Auth0 OAuth2 統合によるログイン、ログアウト、プロフィールページが含まれています
</Card>

クローンして実行します。

```bash theme={null}
git clone https://github.com/auth0-samples/auth0-spring-boot-login-samples.git
cd auth0-spring-boot-login-samples/mvc-login

# Auth0の設定でsrc/main/resources/application.ymlを更新してください
# 次に実行してください:
./gradlew bootRun
```

ブラウザーで `http://localhost:3000` を開き、**ログイン** リンクを選択して Auth0 のログインフローをテストします。
