docs: 图片地址更换为本地文件 (OAuth2篇)

This commit is contained in:
click33
2025-12-29 00:41:34 +08:00
parent 47e8e91056
commit 9378da7a91
4 changed files with 10 additions and 10 deletions

View File

@@ -33,7 +33,7 @@ public class SaOAuth2DataLoaderImpl implements SaOAuth2DataLoader {
当不知情的小红被诱导访问了这个 URL 时,它将被重定向至百度首页。
![oauth2-ticket-jc](https://oss.dev33.cn/sa-token/doc/oauth2-new/oauth2-ticket-jc.png 's-w-sh')
<img class="s-w-sh" src="/big-file/doc/oauth2-new/oauth2-ticket-jc.png" alt="oauth2-ticket-jc" />
可以看到,代表着用户身份的 code 授权码也显现到了URL之中借此漏洞攻击者完全可以构建一个 URL 将小红的 code 授权码自动提交到攻击者自己的服务器,伪造小红身份登录网站。
@@ -64,7 +64,7 @@ public class SaOAuth2DataLoaderImpl implements SaOAuth2DataLoader {
再次访问上述链接:
![oauth2-feifa-rf](https://oss.dev33.cn/sa-token/doc/oauth2-new/oauth2-feifa-rf.png 's-w-sh')
<img class="s-w-sh" src="/big-file/doc/oauth2-new/oauth2-feifa-rf.png" alt="oauth2-feifa-rf" />
URL 没有通过校验,拒绝授权!

View File

@@ -117,11 +117,11 @@ public class SaOAuth2ServerH5Controller {
在前端 ide 中导入 demo 案例的 `sa-token-demo-oauth2-server-h5` 项目,然后直接预览 `oauth2-authorize.html` 页面,如图所示:
![sa-oauth2-server-authorize-h5.png](https://oss.dev33.cn/sa-token/doc/oauth2-new/sa-oauth2-server-authorize-h5.png 's-w-sh')
<img class="s-w-sh" src="/big-file/doc/oauth2-new/sa-oauth2-server-authorize-h5.png" alt="sa-oauth2-server-authorize-h5.png" />
复制上述地址,然后将其配置到 “OAuth2前端测试页” 的 “OAuth2 Server 授权页地址” 选项中,其它选项保持默认不变:
![sa-oauth2-client-test-h5-page-setting.png](https://oss.dev33.cn/sa-token/doc/oauth2-new/sa-oauth2-client-test-h5-page-setting.png 's-w-sh')
<img class="s-w-sh" src="/big-file/doc/oauth2-new/sa-oauth2-client-test-h5-page-setting.png" alt="sa-oauth2-client-test-h5-page-setting.png" />
然后根据 “OAuth2前端测试页” 的页面提示进行测试即可,此处不再赘述。

View File

@@ -227,14 +227,14 @@ http://sa-oauth-server.com:8000/oauth2/authorize?response_type=code&client_id=10
2、由于首次访问我们在OAuth-Server端暂未登录会被转发到登录视图
![sa-oauth2-server-login-view](https://oss.dev33.cn/sa-token/doc/oauth2-new/sa-oauth2-server-login-view--v43.png 's-w-sh')
<img class="s-w-sh" src="/big-file/doc/oauth2-new/sa-oauth2-server-login-view--v43.png" alt="sa-oauth2-server-login-view" />
3、输入 `sa/123456` 进行登录之后,会提示我们确认授权
![sa-oauth2-server-scope](https://oss.dev33.cn/sa-token/doc/oauth2-new/sa-oauth2-server-scope.png 's-w-sh')
<img class="s-w-sh" src="/big-file/doc/oauth2-new/sa-oauth2-server-scope.png" alt="sa-oauth2-server-scope" />
4、点击同意授权之后我们会被重定向至 redirect_uri 页面并携带了code参数
![sa-oauth2-server-code](https://oss.dev33.cn/sa-token/doc/oauth2-new/sa-oauth2-server-code.png 's-w-sh')
<img class="s-w-sh" src="/big-file/doc/oauth2-new/sa-oauth2-server-code.png" alt="sa-oauth2-server-code" />
4、我们拿着code参数访问以下地址
``` url
@@ -272,7 +272,7 @@ http://sa-oauth-server.com:8000/oauth2/token?grant_type=authorization_code&clien
依次启动`OAuth2-Server` 与 `OAuth2-Client`,然后从浏览器访问:[http://sa-oauth-client.com:8002](http://sa-oauth-client.com:8002)
![sa-oauth2-client-index](https://oss.dev33.cn/sa-token/doc/oauth2-new/sa-oauth2-client-index.png 's-w-sh')
<img class="s-w-sh" src="/big-file/doc/oauth2-new/sa-oauth2-client-index.png" alt="sa-oauth2-client-index" />
如图可以针对OAuth2.0四种模式进行详细测试
@@ -286,7 +286,7 @@ OAuth2 前端测试页:
此示例允许你在前端自由配置 OAuth-Client 端所需的各个参数,方便对 OAuth2 四种模式的测试。
![sa-oauth2-client-index](https://oss.dev33.cn/sa-token/doc/oauth2-new/sa-oauth2-client-test-h5-page.png 's-w-sh')
<img class="s-w-sh" src="/big-file/doc/oauth2-new/sa-oauth2-client-test-h5-page.png" alt="sa-oauth2-client-index" />
<p><a class="case-btn case-btn-video" href="https://www.bilibili.com/video/BV13LSMYzEmE/" target="_blank">
参考视频OAuth2 四种模式 前端测试页

View File

@@ -23,7 +23,7 @@ OAuth2.0 与 SSO 相比,增加了对应用授权范围的控制,减弱了应
3. 密码式PasswordClient 端直接拿着用户的账号密码换取授权 `Access-Token`
4. 客户端凭证Client CredentialsServer 端针对 Client 级别的 Token代表应用自身的资源授权。
![https://oss.dev33.cn/sa-token/doc/oauth2/sa-oauth2-setup.png](https://oss.dev33.cn/sa-token/doc/oauth2/sa-oauth2-setup.png)
<img src="/big-file/doc/oauth2-new/sa-oauth2-setup.png" alt="sa-oauth2-setup.png" />
接下来我们将通过简单示例演示如何在 Sa-Token-OAuth2 中完成这四种模式的对接: [搭建OAuth2-Server](/oauth2/oauth2-server)