strip whitespace in docs
This commit is contained in:
14
CHANGELOG.md
14
CHANGELOG.md
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
## 2.1.1
|
## 2.1.1
|
||||||
* Fixed: FIDO2 version in requirements.txt file.
|
* Fixed: FIDO2 version in requirements.txt file.
|
||||||
|
|
||||||
## 2.1.0
|
## 2.1.0
|
||||||
* Added Support for Touch ID for Mac OSx and iOS 14 on Safari
|
* Added Support for Touch ID for Mac OSx and iOS 14 on Safari
|
||||||
|
|
||||||
@@ -26,27 +26,27 @@
|
|||||||
* Fixed: __version__ to show correct version
|
* Fixed: __version__ to show correct version
|
||||||
|
|
||||||
## 2.0.2
|
## 2.0.2
|
||||||
* Added: A missing migration
|
* Added: A missing migration
|
||||||
thnks to @swainn
|
thnks to @swainn
|
||||||
|
|
||||||
## 2.0.1
|
## 2.0.1
|
||||||
* Fixed: issue in migration between Postgres and SQLite
|
* Fixed: issue in migration between Postgres and SQLite
|
||||||
thnks to @swainn and @willingham
|
thnks to @swainn and @willingham
|
||||||
|
|
||||||
## 2.0
|
## 2.0
|
||||||
* Dropped support to djangp-1.8 and Python 2.7
|
* Dropped support to djangp-1.8 and Python 2.7
|
||||||
* Added: never-cache decorator
|
* Added: never-cache decorator
|
||||||
* Fixes to Make Email Method More Robust
|
* Fixes to Make Email Method More Robust
|
||||||
* Addresses several structure and style issues with TOTP and Email dialogs
|
* Addresses several structure and style issues with TOTP and Email dialogs
|
||||||
* Updated to fido2 0.8.1
|
* Updated to fido2 0.8.1
|
||||||
|
|
||||||
Thanks to @swainn
|
Thanks to @swainn
|
||||||
|
|
||||||
## v1.9.1
|
## v1.9.1
|
||||||
* Fixed: is_authenticated #13
|
* Fixed: is_authenticated #13
|
||||||
* Fixed: is_anonymous #6
|
* Fixed: is_anonymous #6
|
||||||
|
|
||||||
thanks to @d3cline,
|
thanks to @d3cline,
|
||||||
|
|
||||||
## v1.7
|
## v1.7
|
||||||
* Better Error Management
|
* Better Error Management
|
||||||
|
|||||||
@@ -5,4 +5,4 @@
|
|||||||
1. activate env `source venv/bin/activate`
|
1. activate env `source venv/bin/activate`
|
||||||
1. install requirements `pip install -r requirements.txt`
|
1. install requirements `pip install -r requirements.txt`
|
||||||
1. migrate `python manage.py migrate`
|
1. migrate `python manage.py migrate`
|
||||||
1. create super user 'python manage.py createsuperuser'
|
1. create super user 'python manage.py createsuperuser'
|
||||||
32
README.md
32
README.md
@@ -7,9 +7,9 @@ A Django app that handles MFA, it supports TOTP, U2F, FIDO2 U2F (Web Authn), Ema
|
|||||||
[](https://pepy.tech/project/django-mfa2)
|
[](https://pepy.tech/project/django-mfa2)
|
||||||
|
|
||||||
### Conda Stats
|
### Conda Stats
|
||||||
[](https://anaconda.org/conda-forge/django-mfa2)
|
[](https://anaconda.org/conda-forge/django-mfa2)
|
||||||
[](https://anaconda.org/conda-forge/django-mfa2)
|
[](https://anaconda.org/conda-forge/django-mfa2)
|
||||||
[](https://anaconda.org/conda-forge/django-mfa2)
|
[](https://anaconda.org/conda-forge/django-mfa2)
|
||||||
|
|
||||||
Web Authencation API (WebAuthn) is state-of-the art techology that is expected to replace passwords.
|
Web Authencation API (WebAuthn) is state-of-the art techology that is expected to replace passwords.
|
||||||
|
|
||||||
@@ -40,17 +40,17 @@ Depends on
|
|||||||
* fido2==0.9.0
|
* fido2==0.9.0
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
1. using pip
|
1. using pip
|
||||||
|
|
||||||
`pip install django-mfa2`
|
`pip install django-mfa2`
|
||||||
2. Using Conda forge
|
2. Using Conda forge
|
||||||
|
|
||||||
`conda config --add channels conda-forge`
|
`conda config --add channels conda-forge`
|
||||||
|
|
||||||
`conda install django-mfa2`
|
`conda install django-mfa2`
|
||||||
|
|
||||||
For more info, see the conda-forge repo (https://github.com/conda-forge/django-mfa2-feedstock)
|
For more info, see the conda-forge repo (https://github.com/conda-forge/django-mfa2-feedstock)
|
||||||
|
|
||||||
Thanks for [swainn](https://github.com/swainn) for adding package to conda-forge
|
Thanks for [swainn](https://github.com/swainn) for adding package to conda-forge
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
@@ -65,7 +65,7 @@ Depends on
|
|||||||
`python manage.py collectstatic`
|
`python manage.py collectstatic`
|
||||||
1. Add the following settings to your file
|
1. Add the following settings to your file
|
||||||
|
|
||||||
```python
|
```python
|
||||||
MFA_UNALLOWED_METHODS=() # Methods that shouldn't be allowed for the user
|
MFA_UNALLOWED_METHODS=() # Methods that shouldn't be allowed for the user
|
||||||
MFA_LOGIN_CALLBACK="" # A function that should be called by username to login the user in session
|
MFA_LOGIN_CALLBACK="" # A function that should be called by username to login the user in session
|
||||||
MFA_RECHECK=True # Allow random rechecking of the user
|
MFA_RECHECK=True # Allow random rechecking of the user
|
||||||
@@ -75,7 +75,7 @@ Depends on
|
|||||||
MFA_RECHECK_MAX=30 # Maximum in seconds
|
MFA_RECHECK_MAX=30 # Maximum in seconds
|
||||||
MFA_QUICKLOGIN=True # Allow quick login for returning users by provide only their 2FA
|
MFA_QUICKLOGIN=True # Allow quick login for returning users by provide only their 2FA
|
||||||
MFA_HIDE_DISABLE=('FIDO2',) # Can the user disable his key (Added in 1.2.0).
|
MFA_HIDE_DISABLE=('FIDO2',) # Can the user disable his key (Added in 1.2.0).
|
||||||
MFA_OWNED_BY_ENTERPRISE = FALSE # Who owns security keys
|
MFA_OWNED_BY_ENTERPRISE = FALSE # Who owns security keys
|
||||||
|
|
||||||
TOKEN_ISSUER_NAME="PROJECT_NAME" #TOTP Issuer name
|
TOKEN_ISSUER_NAME="PROJECT_NAME" #TOTP Issuer name
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ Depends on
|
|||||||
* TOTP
|
* TOTP
|
||||||
* Trusted_Devices
|
* Trusted_Devices
|
||||||
* Email
|
* Email
|
||||||
|
|
||||||
**Notes**:
|
**Notes**:
|
||||||
* Starting version 1.1, ~~FIDO_LOGIN_URL~~ isn't required for FIDO2 anymore.
|
* Starting version 1.1, ~~FIDO_LOGIN_URL~~ isn't required for FIDO2 anymore.
|
||||||
* Starting version 1.7.0, Key owners can be specified.
|
* Starting version 1.7.0, Key owners can be specified.
|
||||||
@@ -99,7 +99,7 @@ Depends on
|
|||||||
1. Break your login function
|
1. Break your login function
|
||||||
|
|
||||||
Usually your login function will check for username and password, log the user in if the username and password are correct and create the user session, to support mfa, this has to change
|
Usually your login function will check for username and password, log the user in if the username and password are correct and create the user session, to support mfa, this has to change
|
||||||
|
|
||||||
* authenticate the user
|
* authenticate the user
|
||||||
* if username and password are correct , check if the user has mfa or not
|
* if username and password are correct , check if the user has mfa or not
|
||||||
* if user has mfa then redirect to mfa page
|
* if user has mfa then redirect to mfa page
|
||||||
@@ -107,17 +107,17 @@ Depends on
|
|||||||
|
|
||||||
```python
|
```python
|
||||||
def login(request): # this function handles the login form POST
|
def login(request): # this function handles the login form POST
|
||||||
user = auth.authenticate(username=username, password=password)
|
user = auth.authenticate(username=username, password=password)
|
||||||
if user is not None: # if the user object exist
|
if user is not None: # if the user object exist
|
||||||
from mfa.helpers import has_mfa
|
from mfa.helpers import has_mfa
|
||||||
res = has_mfa(username = username,request=request) # has_mfa returns false or HttpResponseRedirect
|
res = has_mfa(username = username,request=request) # has_mfa returns false or HttpResponseRedirect
|
||||||
if res:
|
if res:
|
||||||
return res
|
return res
|
||||||
return log_user_in(request,username=user.username)
|
return log_user_in(request,username=user.username)
|
||||||
#log_user_in is a function that handles creatung user session, it should be in the setting file as MFA_CALLBACK
|
#log_user_in is a function that handles creatung user session, it should be in the setting file as MFA_CALLBACK
|
||||||
```
|
```
|
||||||
1. Add mfa to urls.py
|
1. Add mfa to urls.py
|
||||||
```python
|
```python
|
||||||
import mfa
|
import mfa
|
||||||
import mfa.TrustedDevice
|
import mfa.TrustedDevice
|
||||||
urls_patterns= [
|
urls_patterns= [
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
## Break your login function
|
## Break your login function
|
||||||
|
|
||||||
Usually your login function will check for username and password, log the user in if the username and password are correct and create the user session, to support mfa, this has to change
|
Usually your login function will check for username and password, log the user in if the username and password are correct and create the user session, to support mfa, this has to change
|
||||||
|
|
||||||
* authenticate the user
|
* authenticate the user
|
||||||
* if username and password are correct , check if the user has mfa or not
|
* if username and password are correct , check if the user has mfa or not
|
||||||
* if user has mfa then redirect to mfa page
|
* if user has mfa then redirect to mfa page
|
||||||
@@ -11,13 +11,13 @@ Usually your login function will check for username and password, log the user i
|
|||||||
|
|
||||||
```python
|
```python
|
||||||
def login(request): # this function handles the login form POST
|
def login(request): # this function handles the login form POST
|
||||||
user = auth.authenticate(username=username, password=password)
|
user = auth.authenticate(username=username, password=password)
|
||||||
if user is not None: # if the user object exist
|
if user is not None: # if the user object exist
|
||||||
from mfa.helpers import has_mfa
|
from mfa.helpers import has_mfa
|
||||||
res = has_mfa(username = username,request=request) # has_mfa returns false or HttpResponseRedirect
|
res = has_mfa(username = username,request=request) # has_mfa returns false or HttpResponseRedirect
|
||||||
if res:
|
if res:
|
||||||
return res
|
return res
|
||||||
return log_user_in(request,username=user.username)
|
return log_user_in(request,username=user.username)
|
||||||
#log_user_in is a function that handles creatung user session, it should be in the setting file as MFA_CALLBACK
|
#log_user_in is a function that handles creatung user session, it should be in the setting file as MFA_CALLBACK
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Installation & Configuration
|
# Installation & Configuration
|
||||||
1. Install the package
|
1. Install the package
|
||||||
```sh
|
```sh
|
||||||
pip install django-mfa2
|
pip install django-mfa2
|
||||||
```
|
```
|
||||||
@@ -17,27 +17,27 @@
|
|||||||
MFA_RECHECK=True # Allow random rechecking of the user
|
MFA_RECHECK=True # Allow random rechecking of the user
|
||||||
MFA_RECHECK_MIN=10 # Minimum interval in seconds
|
MFA_RECHECK_MIN=10 # Minimum interval in seconds
|
||||||
MFA_RECHECK_MAX=30 # Maximum in seconds
|
MFA_RECHECK_MAX=30 # Maximum in seconds
|
||||||
MFA_QUICKLOGIN=True # Allow quick login for returning users by provide only their 2FA
|
MFA_QUICKLOGIN=True # Allow quick login for returning users by provide only their 2FA
|
||||||
|
|
||||||
TOKEN_ISSUER_NAME="PROJECT_NAME" #TOTP Issuer name
|
TOKEN_ISSUER_NAME="PROJECT_NAME" #TOTP Issuer name
|
||||||
|
|
||||||
U2F_APPID="https://localhost" #URL For U2
|
U2F_APPID="https://localhost" #URL For U2
|
||||||
FIDO_SERVER_ID=u"localehost" # Server rp id for FIDO2, it the full domain of your project
|
FIDO_SERVER_ID=u"localehost" # Server rp id for FIDO2, it the full domain of your project
|
||||||
FIDO_SERVER_NAME=u"PROJECT_NAME"
|
FIDO_SERVER_NAME=u"PROJECT_NAME"
|
||||||
FIDO_LOGIN_URL=BASE_URL
|
FIDO_LOGIN_URL=BASE_URL
|
||||||
```
|
```
|
||||||
|
|
||||||
**Method Names**
|
**Method Names**
|
||||||
* U2F
|
* U2F
|
||||||
* FIDO2
|
* FIDO2
|
||||||
* TOTP
|
* TOTP
|
||||||
* Trusted_Devices
|
* Trusted_Devices
|
||||||
* Email
|
* Email
|
||||||
|
|
||||||
**Note**: Starting version 1.1, ~~FIDO_LOGIN_URL~~ isn't required for FIDO2 anymore.
|
**Note**: Starting version 1.1, ~~FIDO_LOGIN_URL~~ isn't required for FIDO2 anymore.
|
||||||
|
|
||||||
1. Add mfa to urls.py
|
1. Add mfa to urls.py
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import mfa
|
import mfa
|
||||||
import mfa.TrustedDevice
|
import mfa.TrustedDevice
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ site_name: MkLorum
|
|||||||
nav:
|
nav:
|
||||||
- Home: index.md
|
- Home: index.md
|
||||||
- Installation: installation.md
|
- Installation: installation.md
|
||||||
- Code Changes: change_login.md
|
- Code Changes: change_login.md
|
||||||
theme: readthedocs
|
theme: readthedocs
|
||||||
markdown_extensions:
|
markdown_extensions:
|
||||||
- fenced_code
|
- fenced_code
|
||||||
|
|||||||
Reference in New Issue
Block a user