> ## 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

> Ajoutez la connexion Auth0 à une application Web Spring Boot à l’aide du module Okta Spring Boot Starter.

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>
  **Prérequis :**

  * JDK 17+ ([télécharger](https://adoptium.net/))
  * Maven 3.6+ ou Gradle 7+ ([Maven](https://maven.apache.org/download.cgi) | [Gradle](https://gradle.org/install/))
  * Un EDI (IntelliJ IDEA, Eclipse ou VS Code recommandés)

  **Compatibilité des versions de Java :** Spring Boot 3.x+ et Okta Spring Boot Starter 3.x nécessitent Java 17 ou une version ultérieure.
</Note>

<div id="get-started">
  ## Pour commencer
</div>

Ce guide de démarrage rapide montre comment ajouter la connexion Auth0 à une application Web Spring Boot. Vous créerez une application Web sécurisée avec connexion, déconnexion et page de profil protégée à l’aide du Okta Spring Boot Starter, qui configure automatiquement la prise en charge de la connexion OAuth2 de Spring Security.

<Steps>
  <Step title="Créer un nouveau projet" stepNumber={1}>
    Générez un projet Spring Boot avec les dépendances requises.

    <Tabs>
      <Tab title="À l’aide de 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="Ou créez-en un manuellement avec 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="Ajoutez le starter Spring Boot d’Okta" stepNumber={2}>
    Ajoutez la dépendance Okta Spring Boot Starter à votre projet. Elle inclut la prise en charge de la connexion OAuth2 de Spring Security avec une autoconfiguration propre à Auth0/Okta.

    <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="Configurer Auth0" stepNumber={3}>
    Créez une application Web standard dans votre locataire Auth0 et ajoutez la configuration à votre projet.

    Vous pouvez effectuer cette opération automatiquement en exécutant une commande CLI ou manuellement via le tableau de bord :

    <Tabs>
      <Tab title="CLI">
        Exécutez la commande shell suivante dans le répertoire racine de votre projet pour créer une application Auth0 et mettre à jour votre fichier `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 a été créé avec les détails de votre application Auth0 :" && \
            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 a été créé avec les détails de votre application Auth0 :"
            Get-Content "src\main\resources\application.yml"
            ```
          </Tab>
        </Tabs>
      </Tab>

      <Tab title="Tableau de bord">
        Avant de commencer, ajoutez la configuration d’Auth0 à votre fichier `src/main/resources/application.yml` :

        ```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. Accédez au [tableau de bord Auth0](https://manage.auth0.com) → **Applications** → **Applications**.
        2. Cliquez sur **Create Application**.
        3. Saisissez un nom (p. ex., "My Spring Boot Webapp") et sélectionnez **Regular Web Applications**.
        4. Cliquez sur **Create**.
        5. Accédez à l’onglet **Application Settings** et configurez :
           * **Allowed Callback URLs** : `http://localhost:3000/login/oauth2/code/okta`
           * **Allowed Logout URLs** : `http://localhost:3000/`
        6. Copiez le **Domain**, le **Client ID** et le **Client Secret** depuis l’onglet **Application Settings**.
        7. Remplacez les valeurs fictives dans `application.yml`.

        <Info>
          Le **Callback URL** doit correspondre exactement. La connexion OAuth2 de Spring Security utilise par défaut le chemin `/login/oauth2/code/okta`.

          Le **Issuer** doit inclure `https://` et se terminer par `/`. Utilisez uniquement le domaine et la région. Par exemple : `https://dev-abc123.us.auth0.com/`.
        </Info>
      </Tab>
    </Tabs>
  </Step>

  <Step title="Configurer l’authentification" stepNumber={4}>
    Créez une configuration de sécurité qui active la connexion OAuth2 et prend en charge la déconnexion d’Auth0. Les utilisateurs non authentifiés sont automatiquement redirigés vers la page de connexion d’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="Créer des contrôleurs et des vues" stepNumber={5}>
    Créez les contrôleurs et les modèles Thymeleaf pour les pages d’accueil et de profil.

    <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 "Erreur lors de la conversion des claims en 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>Connexion Auth0 avec Spring Boot</title>
      </head>
      <body>
          <h1>Exemple de connexion Auth0 avec Spring Boot</h1>

          <div sec:authorize="!isAuthenticated()">
              <p>Vous n’êtes pas connecté.</p>
              <a href="/oauth2/authorization/okta">Se connecter</a>
          </div>

          <div sec:authorize="isAuthenticated()">
              <p>Bienvenue, <span sec:authentication="name">Utilisateur</span>&nbsp;!</p>
              <ul>
                  <li><a href="/profile">Voir le profil</a></li>
                  <li>
                      <form th:action="@{/logout}" method="post" style="display:inline;">
                          <button type="submit">Se déconnecter</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>Profil de l’utilisateur</title>
      </head>
      <body>
          <h1>Profil de l’utilisateur</h1>
          <a href="/">Accueil</a>

          <div th:if="${profile}">
              <img th:if="${profile['picture']}" th:src="${profile['picture']}" width="64" height="64" alt="Photo de profil" />
              <h2 th:text="${profile['name']}">Nom</h2>
              <p th:text="${profile['email']}">Courriel</p>
          </div>

          <h3>Tous les claims</h3>
          <pre th:text="${profileJson}">Claims en JSON</pre>

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

  <Step title="Lancez votre application" stepNumber={6}>
    Démarrez l’application à l’aide du wrapper Maven ou Gradle.

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

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

    Votre application est maintenant accessible à l’adresse `http://localhost:3000`. Accédez à `http://localhost:3000/profile` pour lancer le processus de connexion Auth0.
  </Step>
</Steps>

<Check>
  Vous devriez maintenant avoir une application Web Spring Boot entièrement fonctionnelle avec la connexion Auth0, exécutée sur votre [localhost](http://localhost:3000/). La page d’accueil est publique, et lorsque vous accédez à `/profile`, les utilisateurs non authentifiés sont redirigés vers la page de connexion Auth0.
</Check>

***

<div id="advanced-usage">
  ## Utilisation avancée
</div>

<Accordion title="Accéder aux claims du profil utilisateur">
  Le paramètre `@AuthenticationPrincipal OidcUser` vous donne accès à tous les claims du jeton d’identification. Utilisez `getClaims()` pour récupérer l’ensemble complet, ou les méthodes d’accès individuelles pour des claims précis.

  ```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="Contrôle d’accès basé sur les rôles">
  Vous pouvez restreindre l’accès aux pages selon les rôles Auth0. Commencez par ajouter les rôles au jeton d’identification à l’aide d’une action Auth0, puis utilisez `hasAuthority()` dans votre configuration de sécurité.

  ### Ajouter des rôles aux jetons

  1. Accédez au [tableau de bord Auth0](https://manage.auth0.com) → **Actions** → **Flows** → **Login**.
  2. Créez une action personnalisée qui ajoute les rôles comme claim personnalisé au jeton d’identification :

  ```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);
    }
  };
  ```

  ### Configurer l’autorisation

  Mettez à jour votre `SecurityConfig` pour exiger des rôles précis sur certains endpoints :

  ```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="Mappage personnalisé des autorités">
  Le Okta Spring Boot Starter prend en charge le mappage personnalisé des autorités au moyen de l’interface `AuthoritiesProvider`. Enregistrez un bean pour ajouter des objets `GrantedAuthority` personnalisés en fonction des attributs utilisateur ou de sources de données externes.

  ```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<>();

              // Mapper le claim de rôles personnalisés vers les autorités 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">
  ## Problèmes courants
</div>

<AccordionGroup>
  <Accordion title="Échec de la redirection vers la connexion - URL de rappel invalide">
    Après avoir cliqué sur Connexion, Auth0 affiche une erreur indiquant que l’URL de rappel ne correspond pas.

    Les **Allowed Callback URLs** de votre application Auth0 doivent correspondre exactement à l’URL de rappel utilisée par Spring Security. Par défaut, il s’agit de `http://localhost:3000/login/oauth2/code/okta`.

    1. Allez dans le [tableau de bord Auth0](https://manage.auth0.com) → **Applications** → votre application → **Settings**.
    2. Sous **Allowed Callback URLs**, ajoutez : `http://localhost:3000/login/oauth2/code/okta`.
    3. Cliquez sur **Save Changes**.
  </Accordion>

  <Accordion title="Issuer invalide au démarrage">
    L’application ne démarre pas ou la connexion échoue en raison d’une non-correspondance de l’issuer.

    Le `okta.oauth2.issuer` doit être l’URL complète du tenant Auth0, y compris `https://` et la barre oblique finale `/`.

    ```yaml theme={null}
    # ❌ INCORRECT - https:// ou la barre oblique finale est manquant
    okta:
      oauth2:
        issuer: "dev-abc123.us.auth0.com"

    # ✅ CORRECT - URL complète avec barre oblique finale
    okta:
      oauth2:
        issuer: "https://dev-abc123.us.auth0.com/"
    ```
  </Accordion>

  <Accordion title="Échec de la découverte OIDC au démarrage">
    L’application ne démarre pas et affiche une erreur de connexion lors de la récupération de `/.well-known/openid-configuration`.

    Le Okta Spring Boot Starter récupère le document de découverte OpenID Connect à partir de l’URL de votre issuer au démarrage. Vérifiez que l’URL de l’issuer est correcte et accessible depuis votre réseau. Si vous êtes derrière un pare-feu d’entreprise, configurez le proxy :

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

  <Accordion title="Valeurs de configuration introuvables">
    L’application démarre, mais la connexion échoue parce que les propriétés de configuration ne sont pas lues.

    Assurez-vous que votre `application.yml` utilise la bonne indentation YAML dans l’espace de noms `okta.oauth2` :

    ```yaml theme={null}
    # ❌ INCORRECT - structure à plat, non imbriquée
    okta.oauth2.issuer: "https://dev-abc123.us.auth0.com/"

    # ✅ CORRECT - YAML correctement imbriqué
    okta:
      oauth2:
        issuer: "https://dev-abc123.us.auth0.com/"
        client-id: "YOUR_CLIENT_ID"
        client-secret: "YOUR_CLIENT_SECRET"
    ```
  </Accordion>

  <Accordion title="La déconnexion n’efface pas la session Auth0">
    Après avoir cliqué sur Déconnexion, l’utilisateur est immédiatement reconnecté sans voir la page de connexion Auth0.

    Assurez-vous que votre `SecurityConfig` inclut le `LogoutHandler` personnalisé qui redirige vers le point de terminaison Auth0 `/v2/logout`. Vérifiez également que les **Allowed Logout URLs** dans les paramètres de votre application Auth0 incluent `http://localhost:3000/`.
  </Accordion>
</AccordionGroup>

***

<div id="additional-resources">
  ## Ressources supplémentaires
</div>

<CardGroup cols={3}>
  <Card title="Documentation du SDK" icon="book" href="https://github.com/okta/okta-spring-boot">
    Documentation complète du SDK, code source et notes de version
  </Card>

  <Card title="Documentation d’Auth0" icon="file-lines" href="https://auth0.com/docs">
    Documentation officielle d’Auth0 pour les applications Spring Boot
  </Card>

  <Card title="Référence Spring Security" icon="shield" href="https://docs.spring.io/spring-security/reference/servlet/oauth2/login.html">
    Documentation sur l’authentification OAuth2 avec Spring Security
  </Card>

  <Card title="Référence de configuration" icon="gear" href="https://github.com/okta/okta-spring-boot#configuration-reference">
    Toutes les propriétés de configuration okta.oauth2.\* disponibles
  </Card>

  <Card title="Tableau de bord Auth0" icon="browser" href="https://manage.auth0.com/">
    Gérez vos API et applications Auth0
  </Card>

  <Card title="Forum de la communauté" icon="comments" href="https://community.auth0.com/">
    Obtenez de l’aide de la communauté Auth0
  </Card>
</CardGroup>

***

<div id="sample-application">
  ## Application exemple
</div>

Une application exemple complète illustrant la connexion, l’affichage du profil et la déconnexion avec Auth0 est offerte dans le dépôt d’exemples Auth0.

<Card title="Exemple de connexion MVC" icon="github" href="https://github.com/auth0-samples/auth0-spring-boot-login-samples/tree/master/mvc-login">
  Comprend la connexion, la déconnexion et une page de profil avec l’intégration OAuth2 d’Auth0
</Card>

Clonez et exécutez :

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

# Mettez à jour src/main/resources/application.yml avec votre configuration Auth0
# Puis exécutez :
./gradlew bootRun
```

Ouvrez `http://localhost:3000` dans votre navigateur et cliquez sur le lien **Connexion** pour tester le flux de connexion Auth0.
