You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use the shouldAddToken token with customBearerTokenInterceptor, but it seems like the bearer token is added to every url, if return false it still added the bearer token,
If using the urlPattern with includeBearerTokenInterceptor it, then it works like expected
const customCondition: CustomBearerTokenCondition = {
shouldAddToken: async (req: any, next: HttpHandlerFn, keycloak: Keycloak) => {
// Add token only for requests to the / api endpoint
return req.url.startsWith('/api') && keycloak.authenticated;
}
};
I think something goes wrong here, shouldAddToken is false but it 's find a matching condition const matchingCondition = conditions.find(async condition => await condition.shouldAddToken(req, next, keycloak));
The text was updated successfully, but these errors were encountered:
gerwinbouwhuis
changed the title
ShouldAddToken is adding bearer token to every url
Bug: ShouldAddToken is adding bearer token to every url
Feb 21, 2025
I use the shouldAddToken token with customBearerTokenInterceptor, but it seems like the bearer token is added to every url, if return false it still added the bearer token,
If using the urlPattern with includeBearerTokenInterceptor it, then it works like expected
I think something goes wrong here, shouldAddToken is false but it 's find a matching condition
const matchingCondition = conditions.find(async condition => await condition.shouldAddToken(req, next, keycloak));
The text was updated successfully, but these errors were encountered: