<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>OAuth on Ricky</title><link>https://linzeyan.github.io/zh-tw/categories/oauth/</link><description>Recent content in OAuth on Ricky</description><generator>Hugo -- gohugo.io</generator><language>zh-tw</language><lastBuildDate>Wed, 06 Jul 2022 08:47:49 +0800</lastBuildDate><atom:link href="https://linzeyan.github.io/zh-tw/categories/oauth/index.xml" rel="self" type="application/rss+xml"/><item><title>OIDC(OpenID Connect) 简介</title><link>https://linzeyan.github.io/zh-tw/posts/2022/20220706-openid-connect/</link><pubDate>Wed, 06 Jul 2022 08:47:49 +0800</pubDate><guid>https://linzeyan.github.io/zh-tw/posts/2022/20220706-openid-connect/</guid><description>&lt;ul>
&lt;li>&lt;a href="https://jiajunhuang.com/articles/2022_07_06-openid_connect.md.html" target="_blank" rel="noopener">OIDC(OpenID Connect) 简介&lt;/a>&lt;/li>
&lt;/ul>
&lt;h3 id="authentication-vs-authorization">Authentication vs. authorization&lt;/h3>
&lt;blockquote>
&lt;p>Authentication 通常是指校验是否是用户本人的这个过程，而 Authorization 则更多的是指用户是否有权限。通常我们都是先校验 是否是用户本人，然后再校验用户是否有权限。也就是先开始 Authentication，再开始 Authorization。&lt;/p>&lt;/blockquote>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Authentication&lt;/th>
&lt;th>Authorization&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Determines whether users are who they claim to be&lt;/td>
&lt;td>Determines what users can and cannot access&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Challenges the user to validate credentials (for example, through passwords, answers to security questions, or facial recognition)&lt;/td>
&lt;td>Verifies whether access is allowed through policies and rules&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Usually done before authorization&lt;/td>
&lt;td>Usually done after successful authentication&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Generally, transmits info through an ID Token&lt;/td>
&lt;td>Generally, transmits info through an Access Token&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Generally governed by the OpenID Connect (OIDC) protocol&lt;/td>
&lt;td>Generally governed by the OAuth 2.0 framework&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Example: Employees in a company are required to authenticate through the network before accessing their company email&lt;/td>
&lt;td>Example: After an employee successfully authenticates, the system determines what information the employees are allowed to access&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h3 id="oauth-2">OAuth 2&lt;/h3>
&lt;h4 id="client-credentials-grant">&lt;a href="https://datatracker.ietf.org/doc/html/rfc6749#section-4.4" target="_blank" rel="noopener">Client Credentials Grant&lt;/a>&lt;/h4>
&lt;blockquote>
&lt;p>这种模式是最简单的，其实就是客户端告诉服务端自己是哪个客户端，服务器就将 access_token 下发&lt;/p></description></item></channel></rss>