网站分成推广怎么做西部数码wordpress
news/
2025/9/27 8:57:17/
文章来源:
网站分成推广怎么做,西部数码wordpress,宁波seo推荐推广平台,科技:开局研发六代战机许禾我有一个带有OAuth2授权和资源服务器的spring boot设置.用户可以通过向/ oauth / token发出POST请求来获取令牌.到现在为止还挺好.但是,我不想通过BASIC auth保护/ oauth / token,而是通过自定义安全过滤器.我尝试了以下内容,但从未调用过DemoAuthenticationFilter#xff1a;…我有一个带有OAuth2授权和资源服务器的spring boot设置.用户可以通过向/ oauth / token发出POST请求来获取令牌.到现在为止还挺好.但是,我不想通过BASIC auth保护/ oauth / token,而是通过自定义安全过滤器.我尝试了以下内容,但从未调用过DemoAuthenticationFilterConfigurationEnableResourceServerprotected static class ResourceServerConfiguration extends ResourceServerConfigurerAdapter {// ...Overridepublic void configure(HttpSecurity http) throws Exception {// ...http.addFilterBefore(new DemoAuthenticationFilter(), BasicAuthenticationFilter.class);http.authorizeRequests().antMatchers(/oauth/token).authenticated();}}此外,如果我尝试将其添加到WebSecurityConfigurerAdapter,则只有在通过OAuth2对请求进行身份验证后才会调用过滤器ConfigurationEnableWebSecuritypublic class WebSecurityConfig extends WebSecurityConfigurerAdapter {// ...Overrideprotected void configure(HttpSecurity http) throws Exception {// ...http.addFilterBefore(new DemoAuthenticationFilter(), BasicAuthenticationFilter.class);http.authorizeRequests().antMatchers(/oauth/token).authenticated();}}一些简单的例子如何实现这一点将非常有帮助.谢谢
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/919270.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!