This sample demonstrates how to add authentication to a Python web app using Auth0.
Before Running application or clonning of code please ensure to do following:
-
To run the sample, make sure you have
python3
andpip
installed. -
create an folder in your system and open cmd in the folder path
-
If you have virtualenv already skip this step otherwise install it use 'pip install virtualenv' & check using 'virtualenv -version'
-
Make an envirnment using 'python -m venv
-
To activate env : '\Scripts\activate' or '\Scripts\activat.bat' can be used either way
-
Clone the repository into the folder
-
Run: 'pip install -r requirements.txt'
-
create an
.env
and populate it with the client ID, domain, secret, callback URL and audience for your Auth0 app. -
.env file
AUTH0_CLIENT_ID= AUTH0_CLIENT_SECRET= AUTH0_DOMAIN= APP_SECRET_KEY=
you will get all above three value in application setting page of auth0 when logined and created application For App_SECRET_KEY use 'openssl rand hex 32' and paste it here run command using shell
-
After this add the following url as suggested:
-
replace localhost by <local_DNS_IP> i.e 127.0.0.1 Register
http://localhost:3000/callback
asAllowed Callback URLs
andhttp://localhost:3000
asAllowed Logout URLs
in your client settings. -
Run
pip install -r requirements.txt
to install the dependencies and runpython server.py
. -
The app will be served at http://localhost:3000/.
Auth0 helps you to:
- Add authentication with multiple authentication sources, either social like Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce, among others,or enterprise identity systems like Windows Azure AD, Google Apps, Active Directory, ADFS or any SAML Identity Provider.
- Add authentication through more traditional username/password databases.
- Add support for linking different user accounts with the same user.
- Support for generating signed JSON Web Tokens to call your APIs and flow the user identity securely.
- Analytics of how, when and where users are logging in.
- Pull data from other sources and add it to the user profile, through JavaScript rules.
- Go to Auth0 and click Sign Up.
- Use Google, GitHub or Microsoft Account to login.
This project is licensed under the MIT license. See the LICENSE file for more info.