Skip to content

MinhTriet2104/authentication-api-server-with-jwt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cài đặt

npm install

Mở Server

Chạy file start_server.bat

Login

POST: "http://localhost:8080/auth/login"

body: {
  "username": "minhtriet2104",
  "password": "1"
}

Response: {
  "accessToken": "...token",
  "refreshToken": "...token"
}

Register

POST: "http://localhost:8080/auth/register"
body: {
  "username": "minhtriet2104",
  "password": "1",
  [oauth2: true/false]
}

Response: {
  "accessToken": "...token",
  "refreshToken": "...token"
}

Refresh Token

POST: "http://localhost:8080/auth/refresh"
body: {
  "refreshToken": "...token",
}

Response: {
  "accessToken": "...token",
}

Logout

DELETE: "http://localhost:8080/auth/logout"
body: {
  "refreshToken": "...token",
}

Test Token get Users

GET: "http://localhost:8080/users"
headers: {
  "Content-Type": "application/json",
  "Authorization": "Bearer ...token"
}

About

Authentication API Server using Express with JWT

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages