• Version 5.2.0
  • Published
  • 125 kB
  • 1 dependency
  • MIT license


npm i @auth0/angular-jwt
yarn add @auth0/angular-jwt
pnpm add @auth0/angular-jwt


JSON Web Token helper library for Angular



variable JWT_OPTIONS

const JWT_OPTIONS: InjectionToken<unknown>;


    class JwtHelperService

    class JwtHelperService {}


      constructor(config?: any);

        property ɵfac

        static ɵfac: i0.ɵɵFactoryDeclaration<JwtHelperService, never>;

          property ɵprov

          static ɵprov: i0.ɵɵInjectableDeclaration<JwtHelperService>;

            property tokenGetter

            tokenGetter: () => string | Promise<string>;

              method decodeToken

              decodeToken: {
              <T = any>(token: string): T | null;
              <T = any>(token: Promise<string>): Promise<T>;
              <T = any>(): T | Promise<T>;

                method getAuthScheme

                getAuthScheme: (
                authScheme: Function | string | undefined,
                request: HttpRequest<any>
                ) => string | undefined;

                  method getTokenExpirationDate

                  getTokenExpirationDate: {
                  (token: string): Date | null;
                  (token: Promise<string>): Promise<Date>;
                  (): Date | Promise<Date>;

                    method isTokenExpired

                    isTokenExpired: {
                    (token?: undefined, offsetSeconds?: number): boolean | Promise<boolean>;
                    (token: string, offsetSeconds?: number): boolean;
                    (token: Promise<string>, offsetSeconds?: number): Promise<boolean>;

                      method urlBase64Decode

                      urlBase64Decode: (str: string) => string;

                        class JwtInterceptor

                        class JwtInterceptor implements HttpInterceptor {}


                          constructor(config: any, jwtHelper: JwtHelperService, document: Document);

                            property allowedDomains

                            allowedDomains: (string | RegExp)[];

                              property authScheme

                              authScheme: string | ((request?: HttpRequest<any>) => string);

                                property disallowedRoutes

                                disallowedRoutes: (string | RegExp)[];

                                  property headerName

                                  headerName: string;

                                    property jwtHelper

                                    jwtHelper: JwtHelperService;

                                      property ɵfac

                                      static ɵfac: i0.ɵɵFactoryDeclaration<JwtInterceptor, never>;

                                        property ɵprov

                                        static ɵprov: i0.ɵɵInjectableDeclaration<JwtInterceptor>;

                                          property skipWhenExpired

                                          skipWhenExpired: boolean;

                                            property standardPorts

                                            standardPorts: string[];

                                              property throwNoTokenError

                                              throwNoTokenError: boolean;

                                                property tokenGetter

                                                tokenGetter: (
                                                request?: HttpRequest<any>
                                                ) => string | null | Promise<string | null>;

                                                  method handleInterception

                                                  handleInterception: (
                                                  token: string | null,
                                                  request: HttpRequest<any>,
                                                  next: HttpHandler
                                                  ) => Observable<HttpEvent<any>>;

                                                    method intercept

                                                    intercept: (
                                                    request: HttpRequest<any>,
                                                    next: HttpHandler
                                                    ) => Observable<HttpEvent<any>>;

                                                      method isAllowedDomain

                                                      isAllowedDomain: (request: HttpRequest<any>) => boolean;

                                                        method isDisallowedRoute

                                                        isDisallowedRoute: (request: HttpRequest<any>) => boolean;

                                                          class JwtModule

                                                          class JwtModule {}


                                                            constructor(parentModule: JwtModule);

                                                              property ɵfac

                                                              static ɵfac: i0.ɵɵFactoryDeclaration<
                                                              [{ optional: true; skipSelf: true }]

                                                                property ɵinj

                                                                static ɵinj: i0.ɵɵInjectorDeclaration<JwtModule>;

                                                                  property ɵmod

                                                                  static ɵmod: i0.ɵɵNgModuleDeclaration<JwtModule, never, never, never>;

                                                                    method forRoot

                                                                    static forRoot: (options: JwtModuleOptions) => ModuleWithProviders<JwtModule>;


                                                                      interface JwtConfig

                                                                      interface JwtConfig {}

                                                                        property allowedDomains

                                                                        allowedDomains?: Array<string | RegExp>;

                                                                          property authScheme

                                                                          authScheme?: string | ((request?: HttpRequest<any>) => string);

                                                                            property disallowedRoutes

                                                                            disallowedRoutes?: Array<string | RegExp>;

                                                                              property headerName

                                                                              headerName?: string;

                                                                                property skipWhenExpired

                                                                                skipWhenExpired?: boolean;

                                                                                  property throwNoTokenError

                                                                                  throwNoTokenError?: boolean;

                                                                                    property tokenGetter

                                                                                    tokenGetter?: (
                                                                                    request?: HttpRequest<any>
                                                                                    ) => string | null | Promise<string | null>;

                                                                                      interface JwtModuleOptions

                                                                                      interface JwtModuleOptions {}

                                                                                        property config

                                                                                        config?: JwtConfig;

                                                                                          property jwtOptionsProvider

                                                                                          jwtOptionsProvider?: Provider;

                                                                                            Package Files (5)

                                                                                            Dependencies (1)

                                                                                            Dev Dependencies (0)

                                                                                            No dev dependencies.

                                                                                            Peer Dependencies (1)


                                                                                            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@auth0/angular-jwt.

                                                                                            • Markdown
                                                                                            • HTML
                                                                                              <a href="https://www.jsdocs.io/package/@auth0/angular-jwt"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>