-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deployed ca44653 with MkDocs version: 1.6.0
- Loading branch information
Showing
20 changed files
with
229 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
<!DOCTYPE html> | ||
<html class="writer-html5" lang="en" > | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="shortcut icon" href="../img/favicon.ico" /> | ||
<title>authentication - Adhocracy+</title> | ||
<link rel="stylesheet" href="../css/theme.css" /> | ||
<link rel="stylesheet" href="../css/theme_extra.css" /> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css" /> | ||
<link href="../assets/_mkdocstrings.css" rel="stylesheet" /> | ||
|
||
<script> | ||
// Current page data | ||
var mkdocs_page_name = "authentication"; | ||
var mkdocs_page_input_path = "authentication.md"; | ||
var mkdocs_page_url = null; | ||
</script> | ||
|
||
<!--[if lt IE 9]> | ||
<script src="../js/html5shiv.min.js"></script> | ||
<![endif]--> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script> | ||
<script>hljs.highlightAll();</script> | ||
</head> | ||
|
||
<body class="wy-body-for-nav" role="document"> | ||
|
||
<div class="wy-grid-for-nav"> | ||
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav"> | ||
<div class="wy-side-scroll"> | ||
<div class="wy-side-nav-search"> | ||
<a href=".." class="icon icon-home"> Adhocracy+ | ||
</a> | ||
</div> | ||
|
||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="..">Home</a> | ||
</li> | ||
</ul> | ||
<p class="caption"><span class="caption-text">HOWTO</span></p> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../installation_dev/">install for development</a> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="../django_shell_basics/">django basics</a> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="../management_commands/">management commands</a> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="../languages_and_translations/">translations</a> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="../howtomkdocs/">create documentation</a> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="../installation_prod/">install on production</a> | ||
</li> | ||
</ul> | ||
<p class="caption"><span class="caption-text">Diagrams</span></p> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../diagrams_modules/">participation modules</a> | ||
</li> | ||
</ul> | ||
<p class="caption"><span class="caption-text">API</span></p> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../api/">code reference</a> | ||
</li> | ||
</ul> | ||
<p class="caption"><span class="caption-text">Explanations</span></p> | ||
<ul class="current"> | ||
<li class="toctree-l1 current"><a class="reference internal current" href="#">authentication</a> | ||
<ul class="current"> | ||
</ul> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="../celery/">celery</a> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="../ckeditor/">ckeditor</a> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="../img_saving_and_deletion/">images</a> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="../project_insights/">project insights</a> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="../img_saving_and_deletion/">images</a> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="../software_architecture/">architecture</a> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="../tests/">tests</a> | ||
</li> | ||
</ul> | ||
<p class="caption"><span class="caption-text">Repository</span></p> | ||
<ul> | ||
<li class="toctree-l1"><a class="" href="https://github.com/liqd/adhocracy-plus">source code</a> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="../contributing/">contribute</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</nav> | ||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> | ||
<nav class="wy-nav-top" role="navigation" aria-label="Mobile navigation menu"> | ||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> | ||
<a href="..">Adhocracy+</a> | ||
|
||
</nav> | ||
<div class="wy-nav-content"> | ||
<div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation"> | ||
<ul class="wy-breadcrumbs"> | ||
<li><a href=".." class="icon icon-home" aria-label="Docs"></a></li> | ||
<li class="breadcrumb-item">Explanations</li> | ||
<li class="breadcrumb-item active">authentication</li> | ||
<li class="wy-breadcrumbs-aside"> | ||
</li> | ||
</ul> | ||
<hr/> | ||
</div> | ||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> | ||
<div class="section" itemprop="articleBody"> | ||
|
||
<h1 id="authentication">Authentication</h1> | ||
<p>We use <a href="https://docs.allauth.org/">Django Allauth</a> for handling user registration, email and social logins via the browser.</p> | ||
<p>For API authentication we setup Django Rest Framework with Simple JWT for authentication via JWT tokens. Existing users can obtain JWT tokens through the TokenObtainPairView. We haven't enabled JWT based registration yet, as this is an implementation for an external partner, and not as part of the software architecture exposing API registration with JWT.</p> | ||
<p>Login: Users can obtain JWT tokens via the <code>/api/token/</code> endpoint. | ||
For testing via the terminal try:</p> | ||
<pre><code>curl -X POST -H "Content-Type: application/json" -d '{"username": "admin","password": "password"}' http://adhocracy.plus/api/token/ | ||
|
||
</code></pre> | ||
<p>For testing in dev and stage servers replace the domain name with <code>http://aplus-dev.liqd.net/api/token/</code> and <code>http://aplus-stage.liqd.net/api/token/</code> respectively. | ||
Make sure to use your corresponding user credentials (username, password).</p> | ||
<p>The response of the above command, will include an access and a refresh token.</p> | ||
<p>For accessing the projects list endpoint <code>/api/app-projects/</code>, user need to supply the obtained JWT token. | ||
E.g testing via the terminal with:</p> | ||
<pre><code>curl -H "Authorization: Bearer <access token from the response>" https://adhocracy.plus/api/app-projects/ | ||
</code></pre> | ||
<p>For accessing a project details, we can lookup the <code>slug</code> key from the projects list, and call the endpoint <code>/api/app-projects/app-testing/</code>, where the slug is <code>app-testing</code>. | ||
E.g for testing in the terminal, we can run:</p> | ||
<pre><code>curl -H "Authorization: Bearer <access token from the response>" https://aplus-dev.liqd.net/api/app-projects/app-testing/ | ||
</code></pre> | ||
<p>The expiration time for JWT access token is 5hrs, after which the user can refresh it by calling the <code>api/token/refresh/</code> with the <code>refresh</code> token obtained during login. | ||
Refresh token expires after 1 day. They expiration times are set in the settings file <code>adhocracy-plus/config/settings/base.py</code> as <code>SIMPLE_JWT</code>.</p> | ||
<p>For more info about how to obtain and refresh a token, visit the <a href="https://django-rest-framework-simplejwt.readthedocs.io/en/latest/getting_started.html#usage">django restframework simple jwt</a> docs.</p> | ||
|
||
</div> | ||
</div><footer> | ||
<div class="rst-footer-buttons" role="navigation" aria-label="Footer Navigation"> | ||
<a href="../api/" class="btn btn-neutral float-left" title="code reference"><span class="icon icon-circle-arrow-left"></span> Previous</a> | ||
<a href="../celery/" class="btn btn-neutral float-right" title="celery">Next <span class="icon icon-circle-arrow-right"></span></a> | ||
</div> | ||
|
||
<hr/> | ||
|
||
<div role="contentinfo"> | ||
<!-- Copyright etc --> | ||
</div> | ||
|
||
Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. | ||
</footer> | ||
|
||
</div> | ||
</div> | ||
|
||
</section> | ||
|
||
</div> | ||
|
||
<div class="rst-versions" role="note" aria-label="Versions"> | ||
<span class="rst-current-version" data-toggle="rst-current-version"> | ||
|
||
|
||
<span><a href="../api/" style="color: #fcfcfc">« Previous</a></span> | ||
|
||
|
||
<span><a href="../celery/" style="color: #fcfcfc">Next »</a></span> | ||
|
||
</span> | ||
</div> | ||
<script src="../js/jquery-3.6.0.min.js"></script> | ||
<script>var base_url = "..";</script> | ||
<script src="../js/theme_extra.js"></script> | ||
<script src="../js/theme.js"></script> | ||
<script> | ||
jQuery(function () { | ||
SphinxRtdTheme.Navigation.enable(true); | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.