Coder Social home page Coder Social logo

auth's Introduction

Auth

An identity provider I made that uses refresh/access token system.

Overview

The identity provider utilizes JSON Web Tokens (JWT) for authentication and implements a refresh/access token system for secure user authentication. To enhance security, the system employs refresh token rotation, which periodically rotates refresh tokens to mitigate the risk of token misuse or compromise. Additionally, breach detection mechanisms are in place to monitor and identify suspicious activities, such as refresh token reuse. These features collectively ensure robust authentication and protection against unauthorized access.

Endpoints

Users

Create User

  • URL: /user
  • Method: POST
  • Description: This endpoint allows users to create a new account. This action requires email verification.

Get All Users

  • URL: /user
  • Method: GET
  • Description: This endpoint retrieves a list of all users.

Check Email Uniqueness

  • URL: /user/unique/email/:email
  • Method: GET
  • Description: This endpoint checks if the provided email is unique.

Check Username Uniqueness

  • URL: /user/unique/username/:username
  • Method: GET
  • Description: This endpoint checks if the provided username is unique.

Update Email

  • URL: /user/updateEmail
  • Method: PUT
  • Description: This endpoint allows users to update their email address. This action requires email verification.

Update Password

  • URL: /user/updatePassword
  • Method: PUT
  • Description: This endpoint allows users to update their password.

Update Username

  • URL: /user/updateUsername
  • Method: PUT
  • Description: This endpoint allows users to update their username. This action does require email verification.

Delete User

  • URL: /user/deleteUser
  • Method: DELETE
  • Description: This endpoint allows users to delete their account.

Forgot Password

  • URL: /user/forgotPassword
  • Method: POST
  • Description: This endpoint is used for initiating the password reset process.

Reset Password

  • URL: /user/resetPassword
  • Method: POST
  • Description: This endpoint is used for resetting the user's password.

Check Reset Password Token

  • URL: /user/checkResetPasswordToken/:token
  • Method: GET
  • Description: This endpoint checks the validity of the reset password token.

Get User by ID

  • URL: /user/:id
  • Method: GET
  • Description: This endpoint retrieves user information by ID.

Authentication

Login

  • URL: /login
  • Method: POST
  • Description: This endpoint is used for user login.

Logout

  • URL: /logout
  • Method: POST
  • Description: This endpoint is used for user logout.

Refresh Access Token

  • URL: /refresh
  • Method: POST
  • Description: This endpoint is used to refresh the access token.

Check If User Is Logged In

  • URL: /isLoggedIn
  • Method: GET
  • Description: This endpoint checks if the user is logged in.

Get User Role

  • URL: /getRole
  • Method: GET
  • Description: This endpoint retrieves the role of the user.

Google OAuth Handler

  • URL: /sessions/oauth/google
  • Method: POST
  • Description: This endpoint handles OAuth authentication with Google.

Get Auto-Logout Time

  • URL: /autoLogoutAt
  • Method: GET
  • Description: This endpoint retrieves the time of auto-logout for the user.

Request Email Verification Code for Logged-In User

  • URL: /requestCode/loggedInUser
  • Method: POST
  • Description: This endpoint is used to request an email verification code for the logged-in user.

Request Email Verification Code for New Email

  • URL: /requestCode/newEmail
  • Method: POST
  • Description: This endpoint is used to request an email verification code for a new email address.

auth's People

Contributors

devwedeloper avatar

Watchers

 avatar

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.