Giter Club home page Giter Club logo

authentication-api's Introduction

Authentication-API

Account: LinkedIn Account: Facebook Account: Twitter Account: Instagram Account: GitHub

Welcome to the Authentication API project. This project is a simple API that allows users to register, login, logout, change password, reset password, change email, and verify email. The API is built with Django and Django Rest Framework.

The API is built with the following technologies:

  • Django
  • Django Rest Framework
  • Djoser
  • Social_django

The API is built with the following features:

  • User Registration
  • User Login
  • User Logout
  • User Account Activation
  • User Password Change
  • User Password Reset
  • User Email Change
  • User Email Change Verification

Running the project

To run the project, follow the instructions below:

  1. Clone the repository
git clone https://github.com/faresemad/Authentication-API.git
  1. Change into the project directory
cd Authentication-API
  1. Create a virtual environment
python3 -m venv venv
  1. Activate the virtual environment
source venv/bin/activate
  1. Install the project dependencies
pip install -r requirements/local.txt
  1. Build the project
make build
  1. Run the project
make up
  1. Access the project on your browser
http://localhost:8000

API Endpoints

you can access the API endpoints on your browser by visiting the following URL:

http://localhost:8000/api/docs/

Social Endpoints

you can access the social endpoints on your browser by visiting the following URL:

  • Google: http://localhost:8000/api/auth/o/google-oauth2/?redirect_uri=http://localhost:8000/api/social-auth/complete/google-oauth2/

    • Notes:
      • You need to set redirect URI in the Google Developer Console to http://localhost:8000/api/social-auth/complete/google-oauth2/
      • You need to set the following environment variables in the .env (this file must be in .envs/ directory) file:
        • SOCIAL_AUTH_GOOGLE_OAUTH2_KEY
        • SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET
      • You need to set the following Settings in Djoser Settings:
            DJOSER = {
                # ...
                "LOGIN_FIELD": "email",
                "SOCIAL_AUTH_TOKEN_STRATEGY": "djoser.social.token.jwt.TokenStrategy",
                "SOCIAL_AUTH_ALLOWED_REDIRECT_URIS": [
                    "http://localhost:8000/api/social-auth/complete/google-oauth2/",
                ],
                # ...
            }
  • Twitter: http://localhost:8000/api/auth/o/twitter/?redirect_uri=http://localhost:8000/api/social-auth/complete/twitter/

    • Notes:
      • You need to set redirect URI in the Twitter Developer Portal to http://localhost:8000/api/social-auth/complete/twitter/
      • You need to set the following environment variables in the .env (this file must be in .envs/ directory) file:
        • SOCIAL_AUTH_TWITTER_KEY
        • SOCIAL_AUTH_TWITTER_SECRET
      • You need to set the following Settings in Djoser Settings:
            DJOSER = {
                # ...
                "SOCIAL_AUTH_ALLOWED_REDIRECT_URIS": [
                    # ...
                    "http://localhost:8000/api/social-auth/complete/twitter/",
                ],
                # ...
            }
  • GitHub: http://localhost:8000/api/auth/o/github/?redirect_uri=http://localhost:8000/api/social-auth/complete/github/

    • Notes:
      • You need to set redirect URI in the GitHub Developer Portal to http://localhost:8000/api/social-auth/complete/github/
      • You need to set the following environment variables in the .env (this file must be in .envs/ directory) file:
        • SOCIAL_AUTH_GITHUB_KEY
        • SOCIAL_AUTH_GITHUB_SECRET
      • You need to set the following Settings in Djoser Settings:
            DJOSER = {
                # ...
                "SOCIAL_AUTH_ALLOWED_REDIRECT_URIS": [
                    # ...
                    "http://localhost:8000/api/social-auth/complete/github/",
                ],
                # ...
            }
  • LinkedIn: http://localhost:8000/api/auth/o/linkedin-oauth2/?redirect_uri=http://localhost:8000/api/social-auth/complete/linkedin-oauth2/

    • Notes:
      • You need to set redirect URI in the LinkedIn Developer Portal to http://localhost:8000/api/social-auth/complete/linkedin-oauth2/
      • You need to set the following environment variables in the .env (this file must be in .envs/ directory) file:
        • SOCIAL_AUTH_LINKEDIN_OAUTH2_KEY
        • SOCIAL_AUTH_LINKEDIN_OAUTH2_SECRET
      • You need to set the following Settings in Djoser Settings:
            DJOSER = {
                # ...
                "SOCIAL_AUTH_ALLOWED_REDIRECT_URIS": [
                    # ...
                    "http://localhost:8000/api/social-auth/complete/linkedin-oauth2/",
                ],
                # ...
            }

authentication-api's People

Contributors

faresemad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

authentication-api's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.