> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trae.cn/llms.txt?lang=zh
> Use this file to discover all available pages before exploring further.

TRAE 企业版支持基于 SAML 2.0 协议的单点登录（SSO）。企业管理员完成 SSO 配置后，企业成员可以在 TRAE 登录页面输入企业邮箱，跳转至企业身份提供方（Identity Provider，IdP）进行身份验证。验证通过后，即可登录 TRAE 企业版。

## 适用客户端 {#hkMOa9ipe}

* TRAE
* TRAE Plugin
* TRAE CLI
* TraeWork 桌面版和网页版
* TRAE 移动端

## SSO 登录流程概览 {#hjqxrB3qz}

<div class="flow-chart-container"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="-0.5 -0.5 1055 826"><defs><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-d4e1f5-1-ffffff-1-s-9120-0"><stop offset="0%" style="stop-color:#D4E1F5"/><stop offset="100%" style="stop-color:#ffffff"/></linearGradient><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-e1d5e7-1-ffffff-1-s-9120-0"><stop offset="0%" style="stop-color:#E1D5E7"/><stop offset="100%" style="stop-color:#ffffff"/></linearGradient><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-ffcccc-1-ffffff-1-s-9120-0"><stop offset="0%" style="stop-color:#FFCCCC"/><stop offset="100%" style="stop-color:#ffffff"/></linearGradient><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-d5e8d4-1-ffffff-1-s-9120-0"><stop offset="0%" style="stop-color:#D5E8D4"/><stop offset="100%" style="stop-color:#ffffff"/></linearGradient></defs><g><rect x="2" y="2" width="120" height="60" rx="9" ry="9" fill="url(#mx-gradient-d4e1f5-1-ffffff-1-s-9120-0)" stroke="#000000" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 32px; margin-left: 3px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">用户</div></div></div></foreignObject></g><rect x="642" y="2" width="120" height="60" rx="9" ry="9" fill="url(#mx-gradient-e1d5e7-1-ffffff-1-s-9120-0)" stroke="#000000" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 32px; margin-left: 643px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">豆包飞书的账号服务</div></div></div></foreignObject></g><rect x="912" y="2" width="140" height="60" rx="9" ry="9" fill="url(#mx-gradient-ffcccc-1-ffffff-1-s-9120-0)" stroke="#000000" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 138px; height: 1px; padding-top: 32px; margin-left: 913px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">企业的身份认证服务</div></div></div></foreignObject></g><path d="M 62 822 L 62 62" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="3 3" pointer-events="stroke"/><path d="M 422 62 L 422 42" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="3 3" pointer-events="stroke"/><path d="M 701.5 822 L 701.5 62" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="3 3" pointer-events="stroke"/><path d="M 981.5 822 L 981.5 62" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="3 3" pointer-events="stroke"/><path d="M 62 102 L 416.63 102" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 421.88 102 L 414.88 105.5 L 416.63 102 L 414.88 98.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="102" y="82" width="274" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 272px; height: 1px; padding-top: 92px; margin-left: 103px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "><div><div style="color:rgb(31, 35, 41)"><p><font style="font-size:12px">访问 TRAE 登录页面, 选择「企业 SSO 登录」</font></p></div></div><font style="font-size:12px"><span></span></font></div></div></div></foreignObject></g><path d="M 423 142 L 68.37 142" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 63.12 142 L 70.12 138.5 L 68.37 142 L 70.12 145.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="219" y="122" width="40" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 132px; margin-left: 239px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">展示邮箱输入页面</div></div></div></foreignObject></g><path d="M 62 182 L 416.63 182" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 421.88 182 L 414.88 185.5 L 416.63 182 L 414.88 178.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="219" y="162" width="40" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 172px; margin-left: 239px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">输入企业邮箱</div></div></div></foreignObject></g><path d="M 422 222 L 695.63 222" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 700.88 222 L 693.88 225.5 L 695.63 222 L 693.88 218.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="352" y="2" width="140" height="60" rx="9" ry="9" fill="url(#mx-gradient-d5e8d4-1-ffffff-1-s-9120-0)" stroke="#000000" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 138px; height: 1px; padding-top: 32px; margin-left: 353px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">TRAE 企业版控制台</div></div></div></foreignObject></g><path d="M 422 822 L 421.59 62" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="3 3" pointer-events="stroke"/><rect x="542" y="202" width="40" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 212px; margin-left: 562px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">请求 SSO 登录</div></div></div></foreignObject></g><path d="M 702 262 L 742 262" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 742 302 L 742 262" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 742 302 L 708.37 302" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 703.12 302 L 710.12 298.5 L 708.37 302 L 710.12 305.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="782" y="272" width="40" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 282px; margin-left: 802px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">匹配企业 SSO 配置</div></div></div></foreignObject></g><path d="M 702 342 L 428.37 342" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="3 3" pointer-events="stroke"/><path d="M 423.12 342 L 430.12 338.5 L 428.37 342 L 430.12 345.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="542" y="322" width="40" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 332px; margin-left: 562px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">返回企业 SSO 登录地址</div></div></div></foreignObject></g><path d="M 422 382 L 68.37 382" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 63.12 382 L 70.12 378.5 L 68.37 382 L 70.12 385.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="219" y="357" width="40" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 367px; margin-left: 239px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">跳转到企业 SSO 登录页面</div></div></div></foreignObject></g><path d="M 62 422 L 977.27 422" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 982.52 422 L 975.52 425.5 L 977.27 422 L 975.52 418.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="462" y="402" width="40" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 412px; margin-left: 482px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">完成企业身份认证</div></div></div></foreignObject></g><path d="M 982 462 L 68.37 462" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="3 3" pointer-events="stroke"/><path d="M 63.12 462 L 70.12 458.5 L 68.37 462 L 70.12 465.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="482" y="442" width="40" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 452px; margin-left: 502px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">认证成功，跳转回 TRAE</div></div></div></foreignObject></g><path d="M 62 502 L 416.63 502" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 421.88 502 L 414.88 505.5 L 416.63 502 L 414.88 498.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="219" y="482" width="40" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 492px; margin-left: 239px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">携带授权凭证返回</div></div></div></foreignObject></g><path d="M 422 542 L 695.63 542" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 700.88 542 L 693.88 545.5 L 695.63 542 L 693.88 538.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="542" y="522" width="40" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 532px; margin-left: 562px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">提交授权凭证</div></div></div></foreignObject></g><path d="M 702 582 L 975.63 582" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 980.88 582 L 973.88 585.5 L 975.63 582 L 973.88 578.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="822" y="562" width="40" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 572px; margin-left: 842px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">验证凭证并获取用户信息</div></div></div></foreignObject></g><path d="M 982 622 L 708.37 622" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="3 3" pointer-events="stroke"/><path d="M 703.12 622 L 710.12 618.5 L 708.37 622 L 710.12 625.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="822" y="602" width="40" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 612px; margin-left: 842px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">返回用户身份信息</div></div></div></foreignObject></g><path d="M 702 662 L 742 662" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 742 702 L 742 662" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 742 702 L 708.37 702" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 703.12 702 L 710.12 698.5 L 708.37 702 L 710.12 705.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="802" y="672" width="40" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 682px; margin-left: 822px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">确认用户身份，建立登录会话</div></div></div></foreignObject></g><path d="M 702 742 L 428.37 742" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="3 3" pointer-events="stroke"/><path d="M 423.12 742 L 430.12 738.5 L 428.37 742 L 430.12 745.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="542" y="722" width="40" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 732px; margin-left: 562px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">登录成功</div></div></div></foreignObject></g><path d="M 422 782 L 68.37 782" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="3 3" pointer-events="stroke"/><path d="M 63.12 782 L 70.12 778.5 L 68.37 782 L 70.12 785.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="219" y="762" width="40" height="20" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 772px; margin-left: 239px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #000000; line-height: 1.2; pointer-events: all; white-space: nowrap; ">进入 TRAE</div></div></div></foreignObject></g></g></svg></div>

参与方说明如下：

<!-- @cols-width: 181,675 -->
| **角色**  | **描述**  |
| --- | --- |
| 用户  | 希望登录 TRAE 的企业成员。  |
| 豆包飞书管理后台  | 企业配置管理平台，用于让企业管理员管理 SSO 登录相关的配置。  |
| TRAE 的账号服务  | TRAE 后端服务，负责 SSO 配置匹配、身份验证和会话管理。  |
| 企业的身份认证服务  | 企业自有的身份认证服务（IdP），如 Okta、Azure AD、Google Workspace 等。  |

流程说明如下：

<!-- @cols-width: 100,209,548 -->
| **序号**  | **步骤**  | **描述**  |
| --- | --- | --- |
| 1  | 发起 SSO 登录  | 企业成员访问 TRAE 登录页面，选择 “企业 SSO 登录” 方式。  |
| 2  | 输入企业邮箱  | 成员输入企业邮箱地址，系统根据邮箱域名找到对应的 SSO 配置。  |
| 3  | 跳转企业认证  | TRAE 将该成员的浏览器重定向至企业的 IdP 页面（如 Okta、Azure AD 等）。  |
| 4  | 完成身份验证  | 该成员在企业的 IdP 页面中完成身份验证（支持账号密码、MFA 等方式）。  |
| 5  | 返回 TRAE  | 认证成功后，浏览器自动跳转回 TRAE。  |
| 6  | 登录完成  | TRAE 的账号服务验证该成员的身份信息，建立登录会话，然后将该用户登入 TRAE。  |

## 配置 SAML 2.0 登录 {#a569c1e0}

### 前置条件 {#448392e3}

开始配置前，请确认已完成以下准备：

* 企业已使用支持 SAML 2.0 的身份提供方（Identity Provider，IdP），例如 Okta、Microsoft Entra ID 或 OneLogin，并拥有相应的 IdP 管理权限。
* 已在 IdP 中创建用于本次对接的 SAML 2.0 应用，并获取该应用的 SAML 单点登录地址、IdP Issuer 和签名公钥证书。具体获取位置和字段名称以 IdP 的配置页面或接入文档为准。
* 已准备可用于验证的企业成员账号，并在 IdP 中授予该账号访问 SAML 应用的权限。用于登录的企业邮箱应与该成员在 TRAE 中使用的邮箱一致。

### 操作步骤 {#6a762b62}


1. 登录 [TRAE 企业版控制台](https://console.enterprise.trae.cn/)。
2. 前往 **企业配置** > **通用设置**。
3. 在 **SSO 登录** 部分，点击 **前往企业管理后台** 按钮。
   你将前往豆包飞书管理后台的 SSO 账号登录配置页面。
   ![Image=2374x1380](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/239006a327ab4e01ae613ead4957510c~tplv-goo7wpa0wc-topic.webp)
4. 在 **认证方式** 区域，选择 **SAML 认证**，填写以下基础参数：
   :::tip 提示
   以下参数应来自同一个 IdP 应用。不同 IdP 的字段名称可能有所不同，请根据参数含义对应填写。
   :::
   <!-- @cols-width: 228,353,310 -->
   | **参数**  | **描述**  | **填写要求**  |
   | --- | --- | --- |
   | SAML 2.0 协议端点  | IdP 接收 SAML 登录请求的地址。成员发起 SSO 登录时，TRAE 会将认证请求发送至该地址，引导成员在 IdP 完成身份验证。  | 填写 IdP 提供的 SSO URL。请完整复制地址，包括协议、域名和路径。  |
   | 身份提供商发布者（IdP Issuer）  | dP 的身份标识，用于校验收到的 SAML 消息是否由预期的身份提供方签发。  | 填写 IdP 提供的 Issuer 或 Entity ID。请确保与 IdP 中的值完全一致，包括大小写、协议和末尾斜杠。  |
   | SAML 证书  | IdP 的签名公钥证书。TRAE 使用证书中的公钥验证 IdP 返回的 SAML 响应或断言签名，以确认认证信息的来源和完整性。  | 填写与 IdP 当前签名私钥配套的公钥证书，并确保证书仍在有效期内。请勿填写私钥、应用密钥或网站 HTTPS 证书。  |
5. 展开 **高级设置**，根据 IdP 的配置要求设置请求签名和响应签名方式。
   * **请求签名**：对 TRAE 向 IdP 发送的 SAML 认证请求进行签名，供 IdP 验证请求的来源和完整性。
      如果 IdP 要求对认证请求进行签名，请勾选 **请求签名**，然后点击下方证书区域的 **复制**，将 TRAE 提供的公钥证书配置到 IdP 中用于验证请求签名的位置。具体导入方式以 IdP 的操作说明为准。
   * **响应签名和断言签名**：用于指定 TRAE 验证 IdP 返回的 SAML 认证结果时所要求的签名类型。请根据 IdP 的签名配置选择至少一项。
      * **响应签名**：IdP 对 SAML 响应（Response）进行签名。启用后，TRAE 会验证响应签名。
      * **断言签名**：IdP 对 SAML 断言（Assertion）进行签名。启用后，TRAE 会验证断言签名。
         如果 IdP 同时对 SAML 响应和断言进行签名，可以同时勾选这两个选项。请确保 TRAE 的签名验证设置与 IdP 的签名配置一致。
6. 点击 **验证并保存**，完成配置验证。
   验证通过后，确认 **SAML 认证** 旁显示 **验证通过**。
7. 打开页面顶部的 **启用/停用 SSO** 开关。

## 设置 SSO 登录的生效范围 {#登录设置}

你可以设置 SSO 登录的生效范围。

1. 在 **登录设置** > **生效范围** 处，点击 **编辑** 按钮。
2. 配置以下参数：
   <!-- @cols-width: 100,785 -->
   | **参数**  | **描述**  |
   | --- | --- |
   | 选中成员  | 纳入生效范围的成员。成员在此范围内且未被列为例外成员时，必须使用 IdP 账号登录。  |
   | 例外成员  | 不受上述强制登录要求限制的成员。即使同时出现在 “选中成员” 中，仍按例外成员处理。  |
   ![Image=2280x734](https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/0a87945982384f6eab8273fd809ae8b0~tplv-goo7wpa0wc-topic.webp)
