Skip to content

dryize/nodejs-socket.io-angular-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nodejs-socket.io-angular-auth

This is a proof of concept product for web socket authentication.

  • NodeJS Typescript project - backend server
  • Ionic5/ Angular8 project - fronend client
  • Web Socket Authentication - 2 methods are implemented
    1. Authenticate on connect using token in query param Authenticate on connect

    2. Authenticate after connected using 'auth' event. Automatically disconnect is not authenticated within x seconds Authenticate after connect

NodeJS Project

  • Web Socket connection lifecycle is managed by: src/services/chat.service.ts
  • Token generation/ validation managed by: src/services/auth.service.ts

Angular/ Ionic Project

  • Web Socket connection lifecycle is managed by: src/app/services/chat/chat.service.ts
  • By default configured to use Auth method 1. Simply remove token from the socket URL for automatic fallback to method 2.

About

Socket authentication demo with Angular/ nodeJS/ SocketIO

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published