-
Notifications
You must be signed in to change notification settings - Fork 0
NgxJwtModule
Richard edited this page Jan 6, 2018
·
1 revision
The NgxJwtModule
is an Angular module that contains the JwtInterceptor
for intercepting HTTP requests and adding an Authorization
header field to the request with a JWT token in the field value.
The module should be imported to the application's root module like so:
imports: [
NgxJwtModule.forRoot({
config: {
tokenGetter: createTokenGetter(),
whitelistedDomains: [],
blacklistedDomains: ['auth-server.com'],
throwNoTokenError: true,
skipWhenExpired: false,
headerName: 'Authorization',
authScheme: 'Bearer'
}
})
]
The JwtInterceptor
will call tokenGetter()
to determine the token to be inserted into the header field's value.