Open OZIOisgood opened 7 months ago
Here's a working example that lets you use KeycloakAngular without other hacks.
Just use this snippet in the providers section of your bootstrapApplication
:
importProvidersFrom(KeycloakAngularModule),
{
provide: KeycloakBearerInterceptor,
useClass: KeycloakBearerInterceptor,
},
provideHttpClient(
withInterceptors([
(req, next) => {
return inject(KeycloakBearerInterceptor)
.intercept(req, {handle: r => next(r)});
},
]),
),
I wrote BearerInterceptor as plain JavaScript function.
But I have a problem with "KeyCloakService injection".
How to use BearerInterceptor properly in Angular 17? (Ignoring the "withInterceptorsFromDi" option)