OAuth2.0认证和授权原理
 
 
 
 
SpringCloud搭建Oauth
 
Java编程中spring boot框架+spring security框架+spring security oauth2框架整合的例子
 
 
 
OAuth2.0认证和授权原理
    





            
2.Spring Boot 2.0 利用 Spring Security 实现简单的OAuth2.0认证方式2

 

https://blog.csdn.net/lixiang987654321/article/details/83381494

OAuth 2.0定义了四种授权方式:

 

      一.密码模式(resource owner password credentials)(为遗留系统设计)(支持refresh token)

      二.授权码模式(authorization code)(正宗方式)(支持refresh token)

  • 这种模式算是正宗的oauth2的授权模式

  • 设计了auth code,通过这个code再获取token

  • 支持refresh token

  • 请求地址:http://localhost:7010/uaa/oauth/authorize?response_type=code&client_id=wx_takeout_client_id&redirect_uri=http://localhost:7010/uaa/login

      三.简化模式(implicit)(为web浏览器应用设计)(不支持refresh token)

  •  这种模式比授权码模式少了code环节,回调url直接携带token
  •  这种模式的使用场景是基于浏览器的应用
  •  这种模式基于安全性考虑,建议把token时效设置短一些
  •  不支持refresh token
  •  implicit模式(隐式模式)和授权码模式(authorization_code)访问差不多,相比之下,少了一步获取code的步骤,而是直接获取token
  • 请求: 用浏览器(此时同授权码模式,浏览器能跳转到登录页面,postman不行)

  • http://localhost:7010/uaa/oauth/authorize?response_type=token&client_id=wx_takeout_client_id&redirect_uri=http://localhost:7010/uaa/login

     四.客户端模式(client credentials)(为后台api服务消费者设计)(不支持refresh token)

  • 这种模式直接根据client的id和密钥即可获取token,无需用户参与

  • 这种模式比较合适消费api的后端服务,比如拉取一组用户信息等

  • 不支持refresh token,主要是没有必要

  • 请求参数:请求头添加上 client_id和client_secret的basic编码,请求提添加grant_type必须设置为client_credentials

 

 https://blog.csdn.net/WYA1993/article/details/85050120

 

springboot+springsecurity+oauth2整合(并用mysql数据库实现持久化客户端数据)

 https://blog.csdn.net/Victor_An/article/details/81510874

 

Spring Boot OAuth2 整合(授权码和password的数据库配置方式)

https://blog.csdn.net/qq_34997906/article/details/89600076

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-17
  • 2021-12-16
  • 2021-11-19
猜你喜欢
  • 2022-01-15
  • 2022-01-10
  • 2022-12-23
  • 2021-12-05
  • 2021-06-22
  • 2022-12-23
  • 2021-11-26
相关资源
相似解决方案