All Projects → bezkoder → angular-8-jwt-authentication

bezkoder / angular-8-jwt-authentication

Licence: other
Demo project for Angular 8 JWT Authentication with HttpInterceptor and Router

Programming Languages

typescript
32286 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to angular-8-jwt-authentication

Mehul.Kothari
mehul-kothari.vercel.app/
Stars: ✭ 47 (+30.56%)
Mutual labels:  angular8
spring-boot-jwt-social-auth
Implementing JWT authentication and integrate Facebook login with it using Spring Boot
Stars: ✭ 32 (-11.11%)
Mutual labels:  jwt-authentication
web-haskell-graphql-postgres-boilerplate
Modern webserver in Haskell: Graphql + Postgresql + Authentication + DB migration + Dotenv and more
Stars: ✭ 114 (+216.67%)
Mutual labels:  jwt-authentication
auth-jwt
www.yiiframework.com/
Stars: ✭ 28 (-22.22%)
Mutual labels:  jwt-authentication
spring-boot-mongodb-security-angular8
Spring Boot, Security, MongoDB, Angular 8: Build Authentication
Stars: ✭ 17 (-52.78%)
Mutual labels:  angular8
react-redux-aspnet-core-webapi
No description or website provided.
Stars: ✭ 34 (-5.56%)
Mutual labels:  jwt-authentication
authentication
A framework agnostic authentication library based on PSR standards
Stars: ✭ 19 (-47.22%)
Mutual labels:  jwt-authentication
task-manager
Task Manager App
Stars: ✭ 19 (-47.22%)
Mutual labels:  jwt-authentication
EasyTokenGenerator
This repo aims to dynamically and simply generate tokens in Token Based systems.
Stars: ✭ 15 (-58.33%)
Mutual labels:  jwt-authentication
MERN Stack Project Ecommerce Hayroo
E-commerce Website | Reactjs | Nodejs | Mongodb | Expressjs | JWT | Tailwind Css
Stars: ✭ 255 (+608.33%)
Mutual labels:  jwt-authentication
spring-security-jwt-csrf
A demonstration of stateless JWT authentication with Spring Security, Spring Boot and Vue js
Stars: ✭ 62 (+72.22%)
Mutual labels:  jwt-authentication
node-js-jwt-auth
Node.js Demo for Token Based Authentication (JWT) with MySQL database
Stars: ✭ 161 (+347.22%)
Mutual labels:  jwt-authentication
spring-boot-oauth2-password-flow
Spring Boot 2 - OAuth2 password-flow with JWT
Stars: ✭ 51 (+41.67%)
Mutual labels:  jwt-authentication
spring-boot-security-postgresql
Spring Boot, Spring Security, PostgreSQL: JWT Authentication & Authorization example
Stars: ✭ 65 (+80.56%)
Mutual labels:  jwt-authentication
nfw
A jsonapi boilerplate for @nfw-core with mikro-orm
Stars: ✭ 23 (-36.11%)
Mutual labels:  jwt-authentication
teanjs
🔥 TypeORM - Express - Angular 8 - NestJS Server Side Rendering (SSR) 😺
Stars: ✭ 62 (+72.22%)
Mutual labels:  angular8
server-authentication-next.js
No description or website provided.
Stars: ✭ 103 (+186.11%)
Mutual labels:  jwt-authentication
angular-progress-bar
This component allow you to easy incorporate progress-bar to angular/ionic project, providing binding and color options
Stars: ✭ 26 (-27.78%)
Mutual labels:  angular8
angular-animations
A sample application exploring the Angular animations module using Angular 8
Stars: ✭ 19 (-47.22%)
Mutual labels:  angular8
symfony5-jwt-restapi
API for Meeting app development
Stars: ✭ 21 (-41.67%)
Mutual labels:  jwt-authentication

Angular 8 JWT Authentication example

Flow for User Registration and User Login

For JWT – Token based Authentication with Web API, we’re gonna call 2 endpoints:

  • POST api/auth/signup for User Registration
  • POST api/auth/signin for User Login

You can take a look at following flow to have an overview of Requests and Responses that Angular 10 Client will make or receive.

angular-8-jwt-authentication-flow

Angular JWT App Diagram with Router and HttpInterceptor

angular-8-jwt-authentication-overview

For more detail, please visit:

Angular 8 JWT Authentication with Web API

Angular 10 JWT Authentication with Web API

With Spring Boot back-end

Angular 8 + Spring Boot: JWT Authentication & Authorization example

Angular 10 + Spring Boot: JWT Authentication & Authorization example

Run ng serve for a dev server. Navigate to http://localhost:4200/.

With Node.js Express back-end

Node.js Express + Angular 8: JWT Authentication & Authorization example

Node.js Express + Angular 10: JWT Authentication & Authorization example

Open app/_helpers/auth.interceptor.js, modify the code to work with x-access-token like this:

...

// const TOKEN_HEADER_KEY = 'Authorization'; // for Spring Boot back-end
const TOKEN_HEADER_KEY = 'x-access-token';   // for Node.js Express back-end

@Injectable()
export class AuthInterceptor implements HttpInterceptor {
  ...

  intercept(req: HttpRequest<any>, next: HttpHandler) {
    ...
    if (token != null) {
      // for Spring Boot back-end
      // authReq = req.clone({ headers: req.headers.set(TOKEN_HEADER_KEY, 'Bearer ' + token) });

      // for Node.js Express back-end
      authReq = req.clone({ headers: req.headers.set(TOKEN_HEADER_KEY, token) });
    }
    return next.handle(authReq);
  }
}

...

Run ng serve --port 8081 for a dev server. Navigate to http://localhost:8081/.

More Practice

Angular 8 CRUD application example with Web API

Angular 8 Pagination example | ngx-pagination

Angular 8 Multiple Files upload example

Fullstack with Node.js Express:

Angular 8 + Node.js Express + MySQL

Angular 8 + Node.js Express + PostgreSQL

Angular 8 + Node.js Express + MongoDB

Fullstack with Spring Boot:

Angular 8 + Spring Boot + MySQL

Angular 8 + Spring Boot + PostgreSQL

Angular 8 + Spring Boot + MongoDB

Fullstack with Django:

Angular 8 + Django Rest Framework

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].