Replies: 10 comments
-
If someone confirms that this should be the case when I have time, I will look for the error |
Beta Was this translation helpful? Give feedback.
-
Thanks @frbuceta I tried with jwt-todo example, confirmed explorer throws 401.
Instead of adding controller routes to whitelist, we can consider make a blacklist: explorer and spec endpoints like /openapi.json, /openapi.yaml should be in the list. WDYT? Like this.configure(AuthenticationBindings.COMPONENT).to({
defaultMetadata: {
strategy: 'JWTStrategy',
// or a better property name
exceptions: ['/explorer', '/openapi.json', '/openapi.yaml']
}
}) |
Beta Was this translation helpful? Give feedback.
-
I think it's a good idea but with extensions you can make that list very long. For example, the Health extension could be another case of exception |
Beta Was this translation helpful? Give feedback.
-
The |
Beta Was this translation helpful? Give feedback.
-
@jannyHou We need to fix all |
Beta Was this translation helpful? Give feedback.
-
It should be fixed by #5807 |
Beta Was this translation helpful? Give feedback.
-
@raymondfeng This issue is actually a feature I would say, not a bug. The explorer is not blocked by default, but after re-configure the authentication component using this.configure(AuthenticationBindings.COMPONENT).to({
defaultMetadata: {
// please note this line enables jwt strategy for ALL endpoints, instead of the decorated ones
strategy: 'JWTStrategy'
}
})
this.component(AuthenticationComponent);
registerAuthenticationStrategy(this, JWTAuthenticationStrategy) Your PR to update the templates is valid, but this story is not quite relevant. It's about skipping endpoints like explorer when apply a default strategy to entire app. |
Beta Was this translation helpful? Give feedback.
-
@jannyHou The explorer endpoints are served by |
Beta Was this translation helpful? Give feedback.
-
@raymondfeng IIUC, the config as: this.configure(AuthenticationBindings.COMPONENT).to({
defaultMetadata: {
// please note this line enables jwt strategy for ALL endpoints, instead of the decorated ones
strategy: 'JWTStrategy'
}
}) will apply to all endpoints including the ones served by |
Beta Was this translation helpful? Give feedback.
-
@raymondfeng #5807 Not resolve the issue. |
Beta Was this translation helpful? Give feedback.
-
Steps to reproduce
The explorer seems to require authentication when it is set:
Expected Behavior
Should be set on all controllers, only controllers
Additional information
Related Issues
#4782 (comment)
See Reporting Issues for more tips on writing good issues
Beta Was this translation helpful? Give feedback.
All reactions