{"id":22412740,"url":"https://github.com/juliegibbs/lunarspace","last_synced_at":"2025-08-23T10:05:40.821Z","repository":{"id":237274472,"uuid":"775071089","full_name":"JulieGibbs/LunarSpace","owner":"JulieGibbs","description":"Build Angular 13 Token based Authentication \u0026 Authorization Application with Web Api and JWT (including HttpInterceptor, Router \u0026 Form Validation).","archived":false,"fork":false,"pushed_at":"2024-03-20T17:52:15.000Z","size":215,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-23T10:02:48.920Z","etag":null,"topics":["angular","javascript","jwt"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JulieGibbs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-20T17:52:10.000Z","updated_at":"2024-03-29T17:35:40.000Z","dependencies_parsed_at":"2024-04-30T17:32:52.142Z","dependency_job_id":null,"html_url":"https://github.com/JulieGibbs/LunarSpace","commit_stats":null,"previous_names":["juliegibbs/lunarspace"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JulieGibbs/LunarSpace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JulieGibbs%2FLunarSpace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JulieGibbs%2FLunarSpace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JulieGibbs%2FLunarSpace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JulieGibbs%2FLunarSpace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JulieGibbs","download_url":"https://codeload.github.com/JulieGibbs/LunarSpace/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JulieGibbs%2FLunarSpace/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271746516,"owners_count":24813568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","javascript","jwt"],"created_at":"2024-12-05T14:10:07.934Z","updated_at":"2025-08-23T10:05:40.634Z","avatar_url":"https://github.com/JulieGibbs.png","language":"TypeScript","readme":"# Angular 13 Login and Registration with JWT and Web API example\n\nBuild Angular 13 Token based Authentication \u0026 Authorization Application with Web Api and JWT (including HttpInterceptor, Router \u0026 Form Validation).\n- JWT Authentication Flow for User Registration (Signup) \u0026 User Login\n- Project Structure with HttpInterceptor, Router\n- How to implement HttpInterceptor\n- Creating Login, Signup Components with Form Validation\n- Angular Components for accessing protected Resources\n- How to add a dynamic Navigation Bar to Angular App\n- Working with Browser Session Storage\n\n## Flow for User Registration and User Login\nFor JWT – Token based Authentication with Web API, we’re gonna call 2 endpoints:\n- POST `api/auth/signup` for User Registration\n- POST `api/auth/signin` for User Login\n\nYou can take a look at following flow to have an overview of Requests and Responses that Angular 13 JWT Authentication \u0026 Authorization Client will make or receive.\n\n![angular-13-login-registration-flow](angular-13-login-registration-flow.png)\n\n## Angular JWT App Diagram with Router and HttpInterceptor\n![angular-13-login-registration-overview](angular-13-login-registration-overview.png)\n\nFor more detail, please visit the tutorial:\n\u003e [Angular Login and Registration with JWT and Web API example](https://bezkoder.com/angular-13-jwt-auth/)\n\n## With Spring Boot back-end\n\n\u003e [Angular + Spring Boot: JWT Authentication and Authorization example](https://bezkoder.com/angular-13-spring-boot-jwt-auth/)\n\n## With Node.js Express back-end\n\n\u003e [Angular + Node.js Express: JWT Authentication and Authorization example](https://bezkoder.com/node-js-angular-13-jwt-auth/)\n\nDepending on the backend you choose, you need to open `app/_helpers/auth.interceptor.js`, modify the code like this:\n```js\n...\n\n// const TOKEN_HEADER_KEY = 'Authorization'; // for Spring Boot back-end\nconst TOKEN_HEADER_KEY = 'x-access-token';   // for Node.js Express back-end\n\n@Injectable()\nexport class AuthInterceptor implements HttpInterceptor {\n  ...\n\n  intercept(req: HttpRequest\u003cany\u003e, next: HttpHandler): Observable\u003cHttpEvent\u003cany\u003e\u003e {\n    ...\n    if (token != null) {\n      // for Spring Boot back-end\n      // authReq = req.clone({ headers: req.headers.set(TOKEN_HEADER_KEY, 'Bearer ' + token) });\n\n      // for Node.js Express back-end\n      authReq = req.clone({ headers: req.headers.set(TOKEN_HEADER_KEY, token) });\n    }\n    return next.handle(authReq);\n  }\n}\n\n...\n```\n\nRun `ng serve --port 8081` for a dev server. Navigate to `http://localhost:8081/`.\n\n## More practice\n\u003e [Angular JWT Refresh Token example with Http Interceptor](https://www.bezkoder.com/angular-12-refresh-token/)\n\n\u003e [Angular CRUD Application example with Web API](https://www.bezkoder.com/angular-13-crud-example/)\n\n\u003e [Angular Pagination example | ngx-pagination](https://www.bezkoder.com/angular-13-pagination-ngx/)\n\n\u003e [Angular File upload example with Progress bar](https://www.bezkoder.com/angular-13-file-upload/)\n\nFullstack with Node:\n\n\u003e [Angular + Node Express + MySQL example](https://www.bezkoder.com/angular-13-node-js-express-mysql/)\n\n\u003e [Angular + Node Express + PostgreSQL example](https://www.bezkoder.com/angular-13-node-js-express-postgresql/)\n\n\u003e [Angular + Node Express + MongoDB example](https://www.bezkoder.com/mean-stack-crud-example-angular-13/)\n\n\u003e [Angular + Node Express: File upload example](https://www.bezkoder.com/angular-13-node-express-file-upload/)\n\nFullstack with Spring Boot:\n\n\u003e [Angular + Spring Boot + H2 Embedded Database example](https://www.bezkoder.com/spring-boot-angular-13-crud/)\n\n\u003e [Angular + Spring Boot + MySQL example](https://www.bezkoder.com/spring-boot-angular-13-mysql/)\n\n\u003e [Angular + Spring Boot + PostgreSQL example](https://www.bezkoder.com/spring-boot-angular-13-postgresql/)\n\n\u003e [Angular + Spring Boot + MongoDB example](https://www.bezkoder.com/angular-13-spring-boot-mongodb/)\n\n\u003e [Angular + Spring Boot: File upload example](https://www.bezkoder.com/angular-13-spring-boot-file-upload/)\n\nFullstack with Django:\n\u003e [Angular + Django example](https://bezkoder.com/django-angular-13-crud-rest-framework/)\n\nServerless with Firebase:\n\u003e [Angular Firebase CRUD with Realtime DataBase | AngularFireDatabase](https://www.bezkoder.com/angular-13-firebase-crud/)\n\n\u003e [Angular Firestore CRUD example with AngularFireStore](https://www.bezkoder.com/angular-13-firestore-crud-angularfirestore/)\n\n\u003e [Angular Firebase Storage: File Upload/Display/Delete example](https://www.bezkoder.com/angular-13-firebase-storage/)\n\nIntegration (run back-end \u0026 front-end on same server/port)\n\u003e [How to integrate Angular with Node Restful Services](https://bezkoder.com/integrate-angular-12-node-js/)\n\n\u003e [How to Integrate Angular with Spring Boot Rest API](https://bezkoder.com/integrate-angular-12-spring-boot/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliegibbs%2Flunarspace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliegibbs%2Flunarspace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliegibbs%2Flunarspace/lists"}