Skip to content

lnobrz/myclients-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Clients Server

Introduction

My Clients Server is a backend designed to handle an user authentication to My Clients account process. It requests, retrieves and refresh authentication credentials.

Requirements

  • NodeJS 18^. Check NodeJs full documentation here.
  • Valid My Clients account, otherwise, requests will return 401 error. You can create an account here.
  • My Clients App, which is the frontend part of this project. Full documentation here.

Usage

Starting Server Locally

After cloning this repository, you'll need to run "npm install" on the root directory of this application, so all dependencies can be installed properly.

On controller/auth.ts:

  • On requestToken controller, change the redirect uri to "http://localhost:8080/...", so the get token request can be made locally
  • On getToken controller, change the redirect uri to "http://localhost:5173/...", so your client side application can receive and store the authentication credentials

Finally, run "npm start" to start running the server locally. Your server should be up and running.

Making Requests

This server supports three different routes:

  • "/": this is the index route. It makes an authentication request to My Clients website, where the user will be redirected and requested to login. After the login, server will redirect to "/get-token/" with the rights credentials to request an access token.

  • "/get-token/": get the necessary query parameters to request an access token. When the access token is retrieved, server will redirect to client side with the credentials in the URI.

  • "/refresh-token": receives an access token as query param and request a new valid access token. When the new access token is retrieved, server will return a JSON response with the new credentials.

Stacks

My Clients Server uses the following tech stacks:

  • Typescript
  • NodeJS
  • Express

Contact Me

Faced any problems? Don't hesitate to contact me on lucasnobre037@gmail.com or lucasnobre37@outlook.com.

About

Server side application made with the purpose of handling authentications requests.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors