oauth2-demo
oauth2-demo copied to clipboard
authorization_code模式 获取access_token之后,如何去请求资源?
authorization_code模式 获取access_token之后如何去请求资源服务器, access_token在哪里传,我直接用get获取不了?
这个作者没有写。其实还是要有一个验证token然后获得请求资源的方法
@zx8329200 找了很久没找到适用的,能否提供下代码
@zx8329200 这个怎么写?网上有大概的例子么?找了好多都无效啊
SecurityConfiguration 类 void configure(HttpSecurity http)方法 改为以下就可以了 http .requestMatchers() .antMatchers("/oauth/","/login/","/logout/") .and() .authorizeRequests() .antMatchers("/oauth/").authenticated() .and() .formLogin().loginPage("/login") .and() .httpBasic().disable() .csrf() // 不需要被csrf过滤的请求 .requireCsrfProtectionMatcher(new AntPathRequestMatcher("/oauth/authorize")) .disable();
@pozhenzi9010 @zx8329200 @shancg 授权码模式demo已更新,pull 之后重新看下吧