Docs - add 'fr' translation + fixes
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
<head><meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1"/>
|
||||
<meta name="color-scheme" content="light dark"><meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Recherche" href="search.html" /><link rel="next" title="Installation" href="installation.html" /><link rel="prev" title="Features" href="features.html" />
|
||||
<link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Recherche" href="search.html" /><link rel="next" title="Installation" href="installation.html" /><link rel="prev" title="Fonctionnalités" href="features.html" />
|
||||
|
||||
<!-- Generated with Sphinx 7.0.1 and Furo 2023.05.20 -->
|
||||
<title>OAuth 2.0 - Documentation FitTrackee 0.7.17</title>
|
||||
@ -163,24 +163,24 @@
|
||||
</form>
|
||||
<div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
|
||||
<ul class="current">
|
||||
<li class="toctree-l1"><a class="reference internal" href="features.html">Features</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="features.html">Fonctionnalités</a></li>
|
||||
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">OAuth 2.0</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="cli.html">Command line interface</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="third_party_tools.html">Third-party tools</a></li>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="api/index.html">API documentation</a><input class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" role="switch" type="checkbox"/><label for="toctree-checkbox-1"><div class="visually-hidden">Toggle navigation of API documentation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="api/auth.html">Authentication and account</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="cli.html">Interface de ligne de commande</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="third_party_tools.html">Outils tiers</a></li>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="api/index.html">Documentation de l’API</a><input class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" role="switch" type="checkbox"/><label for="toctree-checkbox-1"><div class="visually-hidden">Toggle navigation of Documentation de l’API</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="api/auth.html">Authentification et compte</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="api/configuration.html">Configuration</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="api/oauth2.html">OAuth2</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="api/records.html">Records</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="api/sports.html">Sports</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="api/stats.html">Statistics</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="api/users.html">Users</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="api/workouts.html">Workouts</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="api/stats.html">Statistiques</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="api/users.html">Utilisateurs</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="api/workouts.html">Séances</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="troubleshooting/index.html">Troubleshooting</a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" role="switch" type="checkbox"/><label for="toctree-checkbox-2"><div class="visually-hidden">Toggle navigation of Troubleshooting</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="troubleshooting/administrator.html">Administrator</a></li>
|
||||
<li class="toctree-l1 has-children"><a class="reference internal" href="troubleshooting/index.html">Dépannage</a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" role="switch" type="checkbox"/><label for="toctree-checkbox-2"><div class="visually-hidden">Toggle navigation of Dépannage</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="troubleshooting/administrator.html">Administrateur</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Change log</a></li>
|
||||
@ -231,97 +231,88 @@
|
||||
<article role="main">
|
||||
<section id="oauth-2-0">
|
||||
<h1>OAuth 2.0<a class="headerlink" href="#oauth-2-0" title="Lien permanent vers cette rubrique">#</a></h1>
|
||||
<p>(<em>new in 0.7.0</em>)</p>
|
||||
<p>FitTrackee provides a REST API (see <a class="reference external" href="api/index.html">documentation</a>) whose
|
||||
most endpoints require authentication/authorization.</p>
|
||||
<p>To allow a third-party application to interact with API endpoints, an
|
||||
<a class="reference external" href="https://datatracker.ietf.org/doc/html/rfc6749">OAuth2</a> client can be created
|
||||
in user settings (“apps” tab).</p>
|
||||
<p>(<em>nouveau dans la version in 0.7.0</em>)</p>
|
||||
<p>FitTrackee fournit une API REST (voir <a class="reference external" href="api/index.html">documentation</a>) dont la plupart des points d’accès nécessitent une authentification/autorisation.</p>
|
||||
<p>Pour permettre à une application tierce d’interagir avec les points d’accès de l’API, un client <a class="reference external" href="https://datatracker.ietf.org/doc/html/rfc6749">OAuth2</a> peut être créé dans les paramètres de l’utilisateur (onglet “apps”).</p>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Avertissement</p>
|
||||
<p>OAuth2 endpoints requiring authentication are not accessible by third-party
|
||||
applications (<a class="reference external" href="api/oauth2.html">documentation</a>), only by FitTrackee
|
||||
client (first-party application).</p>
|
||||
<p>Les points d’entrée OAuth2 nécessitant une authentification ne sont pas accessibles par des applications tierces (<a class="reference external" href="api/oauth2.html">documentation</a>), seulement par l’application web FitTrackee).</p>
|
||||
</div>
|
||||
<p>FitTrackee supports only <a class="reference external" href="https://datatracker.ietf.org/doc/html/rfc6749#section-1.3.1">Authorization Code</a>
|
||||
flow (with <a class="reference external" href="https://datatracker.ietf.org/doc/html/rfc7636">PKCE</a> support).
|
||||
It allows to exchange an authorization code for an access token.
|
||||
The client ID and secret must be sent in the POST body.
|
||||
It is recommended to use PKCE to provide a better security.</p>
|
||||
<p>Il ne prend en charge que le flux avec un <a class="reference external" href="https://datatracker.ietf.org/doc/html/rfc6749#section-1.3.1">Code d’Autorisation</a> (avec prise en charge de <a class="reference external" href="https://datatracker.ietf.org/doc/html/rfc7636">PKCE</a>). Il permet d’échanger un code d’autorisation contre un jeton d’accès. L’identifiant et le secret du client doivent être envoyés dans le corps du message (méthode « POST »). Il est recommandé d’utiliser PKCE pour assurer une meilleure sécurité.</p>
|
||||
<section id="scopes">
|
||||
<h2>Scopes<a class="headerlink" href="#scopes" title="Lien permanent vers cette rubrique">#</a></h2>
|
||||
<p>The following scopes are available:</p>
|
||||
<p>Les scopes suivants sont disponibles :</p>
|
||||
<ul class="simple">
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">application:write</span></code>: grants write access to application configuration (only for users with administration rights),</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">profile:read</span></code>: grants read access to auth endpoints,</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">profile:write</span></code>: grants write access to auth endpoints,</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">users:read</span></code>: grants read access to users endpoints,</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">users:write</span></code>: grants write access to users endpoints,</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">workouts:read</span></code>: grants read access to workouts-related endpoints,</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">workouts:write</span></code>: grants write access to workouts-related endpoints.</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">application:write</span></code> : permet d’accéder en écriture à la configuration de l’application (uniquement pour les utilisateurs ayant des droits d’administration),</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">profile:read</span></code> : accorde un accès en lecture aux points d’entrée d’authentification/profil utilisateur,</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">profile:write</span></code> : accorde l’accès en écriture aux points d’entrée d’authentification/profil utilisateur,</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">users:read</span></code> : accorde un accès en lecture aux points d’entrée des utilisateurs,</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">users:write</span></code> : accorde un accès en écriture aux points d’entrée des utilisateurs,</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">workouts:read</span></code>: accorde un accès en lecture aux points d’entrée associés aux séances,</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">workouts:write</span></code>: accorde un accès en écriture aux points d’entrée associés aux séances,</p></li>
|
||||
</ul>
|
||||
</section>
|
||||
<section id="flow">
|
||||
<h2>Flow<a class="headerlink" href="#flow" title="Lien permanent vers cette rubrique">#</a></h2>
|
||||
<h2>Flux<a class="headerlink" href="#flow" title="Lien permanent vers cette rubrique">#</a></h2>
|
||||
<ul>
|
||||
<li><p>The user creates an App (client) on FitTrackee for a third-party application.</p>
|
||||
<li><p>L’utilisateur crée une application (client) sur FitTrackee pour une application tierce.</p>
|
||||
<figure class="align-default">
|
||||
<img alt="OAuth2 client creation on FitTrackee" src="_images/fittrackee_screenshot-07.png" />
|
||||
<img alt="Création d'un client OAuth2 sur FitTrackee" src="_images/fittrackee_screenshot-07.png" />
|
||||
</figure>
|
||||
<div class="line-block">
|
||||
<div class="line">After registration, the client id and secret are shown.</div>
|
||||
<div class="line">They must be stored in the 3rd-party application by the user.</div>
|
||||
<div class="line">Après l’enregistrement, l’identifiant et le secret du client sont affichés.</div>
|
||||
<div class="line">Ils doivent être stockés dans l’application tierce par l’utilisateur.</div>
|
||||
</div>
|
||||
</li>
|
||||
<li><div class="line-block">
|
||||
<div class="line">The 3rd-party app needs to redirect to FitTrackee, in order for the user to authorize the 3rd-party app to access user data on FitTrackee.</div>
|
||||
<div class="line">L’application tierce doit rediriger vers FitTrackee, afin que l’utilisateur puisse autoriser l’application tierce à accéder aux données de l’utilisateur sur FitTrackee.</div>
|
||||
</div>
|
||||
<figure class="align-default">
|
||||
<img alt="App authorization on FitTrackee" src="_images/fittrackee_screenshot-08.png" />
|
||||
<img alt="Autorisation de l'application sur FitTrackee" src="_images/fittrackee_screenshot-08.png" />
|
||||
</figure>
|
||||
<div class="line-block">
|
||||
<div class="line">The authorization URL is <code class="docutils literal notranslate"><span class="pre">https://<FITTRACKEE_HOST>/profile/apps/authorize</span></code>.</div>
|
||||
<div class="line">The required parameters are:</div>
|
||||
<div class="line">L’URL pour l’autorisation est <code class="docutils literal notranslate"><span class="pre">https://<FITTRACKEE_HOST>/profile/apps/authorize</span></code>.</div>
|
||||
<div class="line">Les paramètres requis sont les suivants :</div>
|
||||
</div>
|
||||
<ul class="simple">
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">client_id</span></code>: the client id displayed after registration</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">response_type</span></code>: <code class="docutils literal notranslate"><span class="pre">code</span></code>, since FitTrackee only supports Authorization Code flow.</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">scope</span></code>: scopes separated with space.</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">client_id</span></code> : l’identifiant du client affiché après l’enregistrement</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">response_type</span></code> : <code class="docutils literal notranslate"><span class="pre">code</span></code>, FitTrackee ne supportant que le flux de code d’autorisation.</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">scope</span></code> : scopes séparés par des espaces.</p></li>
|
||||
</ul>
|
||||
<div class="line-block">
|
||||
<div class="line">and optional parameters:</div>
|
||||
<div class="line">et des paramètres facultatifs :</div>
|
||||
</div>
|
||||
<ul class="simple">
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">state</span></code>: unique value to prevent cross-site request forgery</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">state</span></code> : valeur unique pour empêcher la falsification des requêtes entre les sites</p></li>
|
||||
</ul>
|
||||
<div class="line-block">
|
||||
<div class="line">For PKCE, the following parameters are mandatory:</div>
|
||||
<div class="line">Pour PKCE, les paramètres suivants sont obligatoires :</div>
|
||||
</div>
|
||||
<ul class="simple">
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">code_challenge</span></code>: string generated from a code verifier</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">code_challenge_method</span></code>: method used to create challenge, for instance « S256 »</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">code_challenge</span></code> : chaîne de caractères générée par un vérificateur de code</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">code_challenge_method</span></code> : méthode utilisée pour créer le challenge, par exemple « S256 »</p></li>
|
||||
</ul>
|
||||
<div class="line-block">
|
||||
<div class="line">Example for PKCE:</div>
|
||||
<div class="line">Exemple pour PKCE:</div>
|
||||
<div class="line"><code class="docutils literal notranslate"><span class="pre">https://<FITTRACKEE_HOST>/profile/apps/authorize?response_type=code&client_id=<CLIENT_ID>&scope=profile%3Aread+workouts%3Awrite&state=<STATE>&code_challenge=<CODE_CHALLENGE>&code_challenge_method=S256</span></code></div>
|
||||
</div>
|
||||
</li>
|
||||
<li><div class="line-block">
|
||||
<div class="line">After the authorization, FitTrackee redirects to the 3rd-party app, so the 3rd-party app can get the authorization code from the redirect URL and then fetches an access token with the client id and secret (endpoint <a class="reference external" href="https://samr1.github.io/FitTrackee/api/oauth2.html#post--api-oauth-token">/api/oauth/token</a>).</div>
|
||||
<div class="line">Example of a redirect URL:</div>
|
||||
<div class="line">Après l’autorisation, FitTrackee redirige vers l’application tierce, de sorte que l’application tierce puisse obtenir le code d’autorisation à partir de l’URL de redirection et récupère ensuite un jeton d’accès avec l’identifiant et le secret du client (point d’accès <a class="reference external" href="https://samr1.github.io/FitTrackee/api/oauth2.html#post--api-oauth-token">/api/oauth/token</a>).</div>
|
||||
<div class="line">Exemple d’URL de redirection :</div>
|
||||
<div class="line"><code class="docutils literal notranslate"><span class="pre">https://example.com/callback?code=<AUTHORIZATION_CODE>&state=<STATE></span></code></div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Note</p>
|
||||
<p>OAuth2 support is implemented with <a class="reference external" href="https://docs.authlib.org/en/latest/">Authlib</a> library.</p>
|
||||
<p>La prise en charge d’OAuth2 est mise en œuvre avec la bibliothèque <a class="reference external" href="https://docs.authlib.org/en/latest/">Authlib</a> bibliothèque.</p>
|
||||
</div>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Avertissement</p>
|
||||
<div class="line-block">
|
||||
<div class="line">If FitTrackee is running behind a proxy, the <code class="docutils literal notranslate"><span class="pre">X-Forwarded-Proto</span></code> header must be set.</div>
|
||||
<div class="line">For instance for <code class="docutils literal notranslate"><span class="pre">nginx</span></code>:</div>
|
||||
<div class="line">Si FitTrackee fonctionne derrière un proxy, l’en-tête <code class="docutils literal notranslate"><span class="pre">X-Forwarded-Proto</span></code> doit être défini.</div>
|
||||
<div class="line">Par exemple pour <code class="docutils literal notranslate"><span class="pre">nginx</span></code> :</div>
|
||||
</div>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>proxy_set_header X-Forwarded-Proto $scheme;
|
||||
</pre></div>
|
||||
@ -329,13 +320,13 @@ It is recommended to use PKCE to provide a better security.</p>
|
||||
</div>
|
||||
</section>
|
||||
<section id="resources">
|
||||
<h2>Resources<a class="headerlink" href="#resources" title="Lien permanent vers cette rubrique">#</a></h2>
|
||||
<p>Some resources about OAuth 2.0:</p>
|
||||
<h2>Ressources<a class="headerlink" href="#resources" title="Lien permanent vers cette rubrique">#</a></h2>
|
||||
<p>Quelques ressources sur OAuth 2.0 :</p>
|
||||
<ul class="simple">
|
||||
<li><p><a class="reference external" href="https://www.oauth.com">OAuth 2.0 Simplified</a> by <a class="reference external" href="https://aaronparecki.com">Aaron Parecki</a> (example for <a class="reference external" href="https://www.oauth.com/oauth2-servers/server-side-apps/example-flow/">authorization code flow with PKCE</a>)</p></li>
|
||||
<li><p><a class="reference external" href="https://www.oauth.com">OAuth 2.0 Simplified</a> par <a class="reference external" href="https://aaronparecki.com">Aaron Parecki</a> (exemple pour le flux avec le <a class="reference external" href="https://www.oauth.com/oauth2-servers/server-side-apps/example-flow/">code d’authorisation et PKCE</a>)</p></li>
|
||||
<li><p><a class="reference external" href="https://requests-oauthlib.readthedocs.io/en/latest/examples/real_world_example.html">Web App Example of OAuth 2 web application flow</a> with Requests-OAuthlib (python)</p></li>
|
||||
<li><p><a class="reference external" href="https://docs.authlib.org/en/latest/client/oauth2.html#oauth-2-session">OAuth 2 Session</a> with Authlib (python)</p></li>
|
||||
<li><p><a class="reference external" href="https://codeberg.org/SamR1/ft-oauth-client">Minimal example of an application interacting with FitTrackee</a> (python)</p></li>
|
||||
<li><p><a class="reference external" href="https://codeberg.org/SamR1/ft-oauth-client">Exemple d’une application minimale interagissant avec FitTrackee</a> (python)</p></li>
|
||||
</ul>
|
||||
</section>
|
||||
</section>
|
||||
@ -361,7 +352,7 @@ It is recommended to use PKCE to provide a better security.</p>
|
||||
<span>Previous</span>
|
||||
</div>
|
||||
|
||||
<div class="title">Features</div>
|
||||
<div class="title">Fonctionnalités</div>
|
||||
|
||||
</div>
|
||||
</a>
|
||||
@ -401,8 +392,8 @@ It is recommended to use PKCE to provide a better security.</p>
|
||||
<ul>
|
||||
<li><a class="reference internal" href="#">OAuth 2.0</a><ul>
|
||||
<li><a class="reference internal" href="#scopes">Scopes</a></li>
|
||||
<li><a class="reference internal" href="#flow">Flow</a></li>
|
||||
<li><a class="reference internal" href="#resources">Resources</a></li>
|
||||
<li><a class="reference internal" href="#flow">Flux</a></li>
|
||||
<li><a class="reference internal" href="#resources">Ressources</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user