SSO、CAS、OAuth、OIDC

这篇具有很好参考价值的文章主要介绍了SSO、CAS、OAuth、OIDC。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

SSO、CAS、OAuth、OIDC

参考

  • 简单了解概念: https://www.bilibili.com/video/BV1XG411w7DN/
  • 简单了解操作: https://www.bilibili.com/video/BV1334y11739/ openid-connect
  • 👍流程图解: https://www.youtube.com/watch?v=t18YB3xDfXI (图:https://developer.okta.com/blog/2019/10/21/illustrated-guide-to-oauth-and-oidc)
  • 流程案例: https://www.youtube.com/watch?v=996OiexHze0
  • 流程案例(with docker Keycloak): https://www.bilibili.com/video/BV1334y11739/
    backup https://archive.org/details/keycloakopenid-connectflow-pundefined-output-264
  • 代码: https://www.bilibili.com/video/BV1hP4y1C7w8/
  • How to Hack OAuth - https://www.youtube.com/watch?v=aU9RsE4fcRM
  • news - https://www.youtube.com/watch?v=g_aVPdwBTfw&list=PLshTZo9V1-aEUg2S84KlisJBAyMEoEZ45

OAuth 2.0

Authentication authN —— 认证 Who are you
Authorization authZ —— 授权 What can you do

OAuth 2.0 is a security standard where you give one application permission to access your data in another application instead of giving them your username and password. You can essentially give one app a key that gives them specific permission to access your data do things on your behalf in another application. —— authorization、delegate authorization

SSO、CAS、OAuth、OIDC

假设一个网站A想要你的联系人目录,你可以把gmail的联系人目录(contacts)给它。这过程就需要gmail授权(authorization)

  • 没登录gmail,登录gmail
  • 登录gmail后,gmail会询问你是否授权
  • 你在gmail点击授权后,生成一个凭证(token)
  • 网站A就可以携带这凭证到gmail中获取你的联系人目录
    • 这一般是网站A后台进行,但协议具体没规定,只规定了gmail可以将你的联系人目录响应给携带token的请求。

OAuth flow: 就是上述(你看得到、看不到)的流程

SSO、CAS、OAuth、OIDC
SSO、CAS、OAuth、OIDC

terminology

  • resource owner - you (the data owner)
  • client - 请求授权的应用(上述网站A)
  • authorization server - the application that knows the resource owner where the resource owner already has a account(上述gmail,认证那部分)
  • resource server - the application programming interface (API) (上述gmail,提供数据那部分)
    (⚠resource serverauthorization server可以是不同的!)
  • redirect url - the URL that the authorization server will redirect the resource owner back to after grant permission to the client
  • response type - the type of information the client expects to receive.
    • code (常见) - 直接响应授权代码(authorization code)
  • scope - 授权的范围,由资源服务商(resource server)自己规定
    • 如上述例子中,可以有如下范围
      • read contacts
      • create contact
      • delete contact
      • read profile
  • consent - the authorization server takes the scopes the client is requesting and verifies with the resource owner whether or not they want to give the client permission.
    SSO、CAS、OAuth、OIDC
  • client id - it is generated by the authorization server and is used to identify the client with the authorization server
  • client secret - a secret password that is generated by the authorization server and only the client and authorization server know. this allows them to secretly share information privately behind the scenes
  • authorization code - a short-lived temporary code the authorization server send back to the client. the client then privately send the authorization code back to the authorization server along with the client secret in exchange for a access token
  • access token - the key the client will use form that point forward to communicate with the resource server. this is like a key or a key card that give the client permission to request data or perform actions with the resource server on your behalf
    SSO、CAS、OAuth、OIDC

SSO、CAS、OAuth、OIDC

example: what’s going on throughout the OAuth flow

  1. you (resource owner) want to allow 网站A (client) to access your contacts
  2. the client redirect your browser to the authorization server and include with the request the client id, redirect uri, response type and one or more scopes it needs
  3. the authorization server verifies who you are and if necessary to prompt a login
  4. the authorization server then presents you with a form based on the scopes requested by the client and you have the opportunity to grant or deny permission
  5. the authorization server redirects back to the client using the redirect uri along with a temporary authorization code
  6. the client then contacts the authorization server directly, which means that the client don’t use the your browser and securely sends its client id and client secret and authorization code
  7. the authorization server verifies the data and responds with an access token
  8. the access token is a value the client dosen’t understand as far as the client is concerned the access token is just a string of gibberish. however the client can use the access token to send request to the resource server
  9. the resource server verifies the access token and if valid responds with the data requested by the client

SSO、CAS、OAuth、OIDC
SSO、CAS、OAuth、OIDC
SSO、CAS、OAuth、OIDC
SSO、CAS、OAuth、OIDC
SSO、CAS、OAuth、OIDC
SSO、CAS、OAuth、OIDC
SSO、CAS、OAuth、OIDC

OAuth Server (well-known authorization server)

  • https://oauth2.thephpleague.com
  • Google OAuth playground
  • https://openidconnect.net
  • https://developer.okta.com

OIDC - OpenID connect

OAuth 2.0 只设计了授权(authorization)环节。在这个授权环节中,数据请求方(客户端,client)最终只拿到一个可以去取数据的access token。在取得数据前,client都无法知道你(you, resource owner)是谁

OIDC is a thin layer that site on top of OAuth 2.0 that adds functionality around login and profile information about the person who is logging in

instead of a key, OIDC is like giving the client application a badge (标记) the badge not only gives the clients specific permission it also provides some basic information about who you are

SSO、CAS、OAuth、OIDC

where OAuth enables authorization from one app to another, OIDC enable a client to establish a login session often referred to as authentication as well as to gain information about the person login in the resource owner which is often called identity

when an authorization server supports OIDC is sometimes called an identity provider since it provides information about the resource owner back to the client

OpenID connect enables scenarios where one login can be use across multiple applications also known as single sign-on SSO. for example an application could support SSO with social networking services such as Facebook or Twitter so that users can choose to leverage a login they already have and are comfortable using

SSO、CAS、OAuth、OIDC

example

  1. you点击client中的授权链接
  2. 💡 client将的的浏览器重定向到authorization server地址,其中scopeopenid (而不再是什么read contacts、delete contact、…)
  3. authorization server校验you
  4. authorization server询问you
  5. authorization serverclient响应authorization code
  6. client携带authorization code和其他信息与authorization server联系
  7. 💡 authorization server校验信息无误后返回access tokenid token
    这里的id token是携带你信息的,这些信息可以被client识别、存储。它的格式一般是json,称为JSON web token,JWT。这里包含的信息成为之claims
    SSO、CAS、OAuth、OIDC

SSO、CAS、OAuth、OIDC

3 - 6 stop are same

SSO、CAS、OAuth、OIDC

通过IODC,client拿到你在resource server中的登录信息

Hack OAuth

RFC 6749 Section 10
RFC 8252 Section 8
RFC 6819
draft-ietf-oauth-security-topics

AppAuth.io

SSO、CAS、OAuth、OIDC

todo https://blog.csdn.net/LawssssCat/article/details/105065992
todo https://lawsssscat.blog.csdn.net/article/details/106989017
todo https://lawsssscat.blog.csdn.net/article/details/104811038
todo 整理关键词:oauth、auth、认证、…文章来源地址https://www.toymoban.com/news/detail-453703.html

到了这里,关于SSO、CAS、OAuth、OIDC的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 【springboot+vue项目(十四)】基于Oauth2的SSO单点登录(一)整体流程介绍

    场景:现在有一个前后端分离的系统,前端框架使用vue-element-template,后端框架使用springboot+springSecurity+JWT+Redis(登录部分)现在需要接入到 已经存在的第三方基于oauth2.0的非标准接口 统一认证系统。  温馨提示:如果是接入到 基于oauth2.0的 标准接口的认证服务系统,可以直

    2024年02月19日
    浏览(32)
  • 【springboot+vue项目(十五)】基于Oauth2的SSO单点登录(二)vue-element-admin框架改造整合Oauth2.0

    Vue-element-admin 是一个基于 Vue.js 和 Element UI 的后台管理系统框架,提供了丰富的组件和功能,可以帮助开发者快速搭建现代化的后台管理系统。 vue-element-admin/   |-- build/                          # 构建相关配置文件   |    |-- build.js                   # 生产环境构建脚本

    2024年02月20日
    浏览(32)
  • 深入探讨安全验证:OAuth2.0、Cookie与Session、JWT令牌、SSO与开放授权平台设计

    认证和授权是安全验证中的两个重要概念。认证是确认身份的过程,用于建立双方之间的信任关系。只有在认证成功的情况下,双方才可以进行后续的授权操作。授权则是在认证的基础上,确定用户或系统对资源的访问权限。 在设计一个权限认证框架时,可以考虑以下原则:

    2024年02月12日
    浏览(24)
  • 什么是SSO?

    SSO(Single Sign On)单点登录。SSO是在多个应用系统中,用户只需要登录一次就可以访问所有相互信任的应用系统。它包括可以将这次主要的登录映射到其他应用中用于同一个用户的登录的机制。它是目前比较流行的企业业务整合的解决方案之一。 当用户第一次访问应用系统

    2024年02月01日
    浏览(18)
  • 什么是SSO

    「SSO」 (单一登录single sign on)是一种身份验证机制,它允许用户使用单一的凭据登录到多个相关应用程序或系统中。换句话说,用户只需一次登录,就可以访问多个不同的应用程序,无需为每个应用程序单独登录。 SSO的工作原理基于身份验证和令牌的概念。当用户进行第一

    2024年02月07日
    浏览(22)
  • 【单点登录SSO认证中心】

    (2017-09-22更新)GitHub:https://github.com/sheefee/simple-sso 1、http无状态协议 web应用采用browser/server架构,http作为通信协议。http是无状态协议,浏览器的每一次请求,服务器会独立处理,不与之前或之后的请求产生关联,这个过程用下图说明,三次请求/响应对之间没有任何联系 但这

    2024年02月13日
    浏览(29)
  • 单点登录(SSO)详解

    文章目录 前言 一、单点登录是什么? 二、单点登录的实现方式 1.Cookie方案: 2.Session方案: 3.Token方案: 三、JWT是什么 1.JWT的概况 2.JWT的组成 3.JWT的用法 4.JWT优缺点 四、Token实现单点登录(代码) 1.添加JWT依赖与JWT工具类 2.编写登录方法 总结 在分布式项目架构中,为了提高

    2024年02月13日
    浏览(27)
  • 飞书-SSO单点登录

    飞书 sso 单点登录 可以参考 飞书js-sdk Documentation - Feishu Open Platform 实现效果 核心代码 注意: 核心代码-封装qrcode方法 在 .vue 中的使用注意点 1.随时更新 currentTab[tab选中的值] 的值 2.首次二维码的更新可能有异步问题,需要借助 nextTick[钩子] 部分核心代码(vue2.0)

    2024年04月29日
    浏览(33)
  • SSO2.0 20-20230705

                                 

    2024年02月12日
    浏览(22)
  • 从普通登录到单点登录(SSO)

    随着前端登录场景的日益复杂化和技术思想的不断演进,前端在登录方面的知识结构变得越来越复杂。对于前端开发者来说,在日常工作中根据不同的登录场景提供合适的解决方案是我们的职责所在,本文将梳理前端登录的演变过程,希望能帮助跟我遇到同样问题的开发者。

    2024年01月18日
    浏览(29)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包