Giter Site home page Giter Site logo

authproject's Introduction

AuthProject

This is a basic authentication and CRUD API.

To begin with, a user must signup at /signup using the following details : name, email, password and role. All are strings. The user is assigned the role that is sent, provided it exists in the database. If it doesn't, user is requested to create the role by sending a post request at /role

In order to create a role, one must send the following: name, scopes[]. Each role has a list of scopes that determine whether a user has access to the resources or not. They are as follows:

  1. user-get
  2. role-get
  3. student-get
  4. student-create
  5. school-create
  6. school-get

They must be mentioned in string form in the scopes array.

Role "Admin" has all scopes.

Once the user signs up, they must sign in at /signin using email and password (both strings). A cookie is created using json web token.

The following routes are available. If user does not have access to any of these routes, they will be notified.

  1. /signup [POST]
  2. /signin [POST]
  3. /user [GET]
  4. /user/:id [GET]
  5. /role [POST]
  6. /role [GET]
  7. /student [POST]
  8. /student [GET]
  9. /school [POST]
  10. /school [GET]

The user can do a number of functions:

  1. get all users using /user
  2. get a single user using /user/:id where id is the object id of the single user targetted
  3. create a student using /student under their own account
  4. get all students in their account using /student
  5. create a school using /school
  6. get all schools using /school

authproject's People

Contributors

jyotsna555 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.