All Projects → ngx-api-utils → Ngx Api Utils

ngx-api-utils / Ngx Api Utils

Licence: mit
ngx-api-utils is a lean library of utilities and helpers to quickly integrate any HTTP API (REST, Ajax, and any other) with Angular.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Ngx Api Utils

Cerberus
A demonstration of a completely stateless and RESTful token-based authorization system using JSON Web Tokens (JWT) and Spring Security.
Stars: ✭ 482 (+423.91%)
Mutual labels:  rest-api, rest, authentication, jwt
Auth
Authenticator via oauth2
Stars: ✭ 118 (+28.26%)
Mutual labels:  library, authentication, jwt, oauth2
Node Express Mongoose Passport Jwt Rest Api Auth
Node, express, mongoose, passport and JWT REST API authentication example
Stars: ✭ 146 (+58.7%)
Mutual labels:  rest-api, rest, jwt, jwt-token
Cloudfront Auth
An AWS CloudFront [email protected] function to authenticate requests using Google Apps, Microsoft, Auth0, OKTA, and GitHub login
Stars: ✭ 471 (+411.96%)
Mutual labels:  authentication, jwt, oauth2
Guns
Guns基于SpringBoot 2,致力于做更简洁的后台管理系统,完美整合springmvc + shiro + mybatis-plus + beetl!Guns项目代码简洁,注释丰富,上手容易,同时Guns包含许多基础模块(用户管理,角色管理,部门管理,字典管理等10个模块),可以直接作为一个后台管理系统的脚手架!
Stars: ✭ 3,327 (+3516.3%)
Mutual labels:  rest-api, rest, jwt
Flask Appbuilder
Simple and rapid application development framework, built on top of Flask. includes detailed security, auto CRUD generation for your models, google charts and much more. Demo (login with guest/welcome) - http://flaskappbuilder.pythonanywhere.com/
Stars: ✭ 3,603 (+3816.3%)
Mutual labels:  rest-api, rest, authentication
Dj Rest Auth
Authentication for Django Rest Framework
Stars: ✭ 491 (+433.7%)
Mutual labels:  rest-api, authentication, jwt
Next Auth
Authentication for Next.js
Stars: ✭ 8,362 (+8989.13%)
Mutual labels:  authentication, jwt, oauth2
Cierge
🗝️ Passwordless OIDC authentication done right
Stars: ✭ 1,245 (+1253.26%)
Mutual labels:  authentication, jwt, oauth2
Auth0.js
Auth0 headless browser sdk
Stars: ✭ 755 (+720.65%)
Mutual labels:  authentication, jwt, oauth2
Jose Jwt
Ultimate Javascript Object Signing and Encryption (JOSE) and JSON Web Token (JWT) Implementation for .NET and .NET Core
Stars: ✭ 692 (+652.17%)
Mutual labels:  jwt, oauth2, jwt-token
Go Book Store Api
Go Sample project to understand Mysql CRUD operation with best practises Includes logging, JWT, Swagger and Transactions
Stars: ✭ 18 (-80.43%)
Mutual labels:  rest-api, jwt, jwt-token
Caddy Auth Portal
Authentication Plugin for Caddy v2 implementing Form-Based, Basic, Local, LDAP, OpenID Connect, OAuth 2.0 (Github, Google, Facebook, Okta, etc.), SAML Authentication
Stars: ✭ 291 (+216.3%)
Mutual labels:  authentication, jwt, oauth2
Jaguar
Jaguar, a server framework built for speed, simplicity and extensible. ORM, Session, Authentication & Authorization, OAuth
Stars: ✭ 286 (+210.87%)
Mutual labels:  rest-api, rest, authentication
Vouch Proxy
an SSO and OAuth / OIDC login solution for Nginx using the auth_request module
Stars: ✭ 1,239 (+1246.74%)
Mutual labels:  authentication, jwt, oauth2
Codeigniter Jwt Sample
CodeIgniter JWT Sample
Stars: ✭ 144 (+56.52%)
Mutual labels:  rest-api, rest, jwt
Rest Api Examples
Test and Prototype with Fake Online REST/OAuth 2 APIs Examples
Stars: ✭ 13 (-85.87%)
Mutual labels:  rest-api, rest, oauth2
Jersey Jwt
Example of REST API with JWT authentication using Jersey, Jackson, Undertow, Weld, Hibernate and Arquillian.
Stars: ✭ 131 (+42.39%)
Mutual labels:  rest-api, rest, jwt
Ssm
👅基于RESTful风格的前后端分离的SSM框架,集成了shiro和swagger等框架
Stars: ✭ 141 (+53.26%)
Mutual labels:  rest-api, rest, jwt
Django Graphql Jwt
JSON Web Token (JWT) authentication for Graphene Django
Stars: ✭ 649 (+605.43%)
Mutual labels:  authentication, jwt, oauth2

npm version

ngx-api-utils

ngx-api-utils is a lean library of utilities and helpers to quickly integrate any HTTP API (REST, Ajax, and any other) with Angular.

Inspired by:

Thanks to the respective developers, people and contributors of:

Getting started

Installation

To install the package from npm - run npm install ngx-api-utils

Setup

import { NgxApiUtilsModule } from 'ngx-api-utils';

@NgModule({
  ...
  imports: [NgxApiUtilsModule,...]
  ...
})
export class AppModule { }

Usage

The package consists of couple of main services and a module that you would use:

  • AuthTokenService to allow you to easily work with any kind of tokens, including but not limited to JWT, Oauth2 with JWT container, etc.
    • which you would provide with a proper TokenDecoder
    • you would also like to provide with proper TokenPayload by extending it with the properties you have in the token especially if you are using JWT Token or other that can contain relevant for your application information
    • you might want to provide it with your custom TokenStorage implementation especially if you are not happy with the default localStorage
  • ApiHttpService that behaves 100% like Angular's HttpClient, but helps you by utilizing for you
    • the AuthTokenService internally and sending the token on each request using ApiAuthorizationHeaderInterceptor
    • also allows you to set API base url, by providing where the HTTP API is thanks to API_HTTP_BASE_URL
    • also allows you to set default HTTP headers with ApiDefaultHeadersInterceptor
    • also only in case needed you can plug ApiErrorsInterceptor and read through it the last error
    • or even better - have your own implementation of any interceptor you need - to handle errors, transform results or anything you would the same way you would do for Angular's HttpClient, just provide it like the defaults are provided with API_HTTP_INTERCEPTORS injection token e.g. {provide: API_HTTP_INTERCEPTORS, useClass: YourCoolInterceptor, multi: true} to line up with the rest of the default provided API_HTTP_INTERCEPTORS
  • ApiAuthGuardService that is a perfectly sane option of you just have public and private part that needs to be protected based on AuthTokenService validity and you want a bit more
    • you can of course configure it with urls for API_AUTH_GUARD_URL_FOR_AUTHENTICATED and API_AUTH_GUARD_URL_FOR_AUTHENTICATION, also a RegExp for API_AUTH_GUARD_PUBLIC_ONLY_ROUTES
  • NgxApiUtilsModule that provides a default set of interceptors for API_HTTP_INTERCEPTORS used by the ApiHttpService which you can configure through providing your own values for the relevant injection tokens

For more details, please check:

Demo

This repository contains a Demo app (TBD) that is intended to show a bit more complex app and how the ngx-api-utils package fits in.

In the demo beside the usage of ngx-api-utils I would strongly recommend checking:

  • the overall structure of well organized lazy loaded modules https://github.com/ngx-api-utils/ngx-api-utils/tree/master/src/app though the router configurations
  • the overall multi-layout system for the UI (HTML/CSS), that allows you to have different UI layouts for the different app sections (roles)
  • the overall way how to organize your services around and build object models that utilize the ngx-api-utils (TBD)

Want to help?

The project uses the following things, you should get familiar with:

Please feel free to submit PRs for the following things:

  • test coverage - unit; integration tests; e2e tests on the demo app;
  • demo project - showing the package in action in a bit more advanced architecture of modules and routing, namely public section, customer section, admin section of the app
  • demo project fake api - needs updates according to what the demo would show
  • contribute further - any additional features and bug fixes

We highly appreciate your contribution!

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].