I have an ionic 3 application where I want to use the touchId feature.
The backend API is being developed in .net.
For my authentication model, I\'m thinking tha
you can use angular2-jwt, it works perfectly and send your token automatically with all your http requests and you can manage your token expiration very easy
you can only give the source of your access token in your config file from ionic storage, here is the config for ionic:
import { JwtModule, JWT_OPTIONS } from '@auth0/angular-jwt';
import { Storage } from '@ionic/storage';
export function jwtOptionsFactory(storage) {
return {
tokenGetter: () => {
return storage.get('access_token');
}
}
}
@NgModule({
imports: [
JwtModule.forRoot({
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [Storage]
}
})
]})