跳转到主要内容
步骤 1:在 Teable 中创建认证提供商
- 进入 Teable 的 SSO 设置页面
- 创建新的认证提供商,命名为 Google Workspace 并选择 OpenID Connect
步骤 2:访问 Google Cloud Console
- 访问 Google Cloud Console
- 使用你的 Google Workspace 管理员账户登录
- 选择或创建一个用于 Teable SSO 集成的项目
步骤 3:启用 Google Identity Services
- 在 Google Cloud Console 中,导航至 APIs & Services → Library
- 搜索 Google Identity 或 Google+ API
- 如果尚未启用,点击 Enable
步骤 4:配置 OAuth 同意屏幕
- 进入 APIs & Services → OAuth consent screen
- 选择 Internal(仅限 Google Workspace 用户)或 External
- 填写必要信息:
- App name(应用名称):Teable SSO
- User support email(用户支持邮箱):你的邮箱地址
- App logo(应用徽标):(可选)上传 Teable 徽标
- Authorized domains(授权域名):添加你的 Teable 域名
- Developer contact information(开发者联系信息):你的邮箱地址
- 点击 Save and Continue
配置范围
- 点击 Add or Remove Scopes
- 添加以下范围:
- 点击 Update,然后点击 Save and Continue
添加测试用户(如果使用 External)
如果选择了 “External”,在开发期间添加测试用户:
- 点击 Add Users
- 输入测试用户的电子邮件地址
- 点击 Save and Continue
步骤 5:创建 OAuth 客户端 ID
- 进入 APIs & Services → Credentials
- 点击 Create Credentials → OAuth client ID
- 选择 Web application 作为应用程序类型
- 配置客户端:
- Name(名称):Teable SSO Client
- Authorized JavaScript origins(授权的 JavaScript 来源):(可选)
https://app.teable.io
- Authorized redirect URIs(授权的重定向 URI):粘贴 Teable 中的回调 URL
- 点击 Create
步骤 6:保存客户端凭据
创建 OAuth 客户端后,会弹出一个对话框显示你的凭据:
- 复制 Client ID(客户端 ID)
- 复制 Client Secret(客户端密钥)
- 点击 OK
- 将这两个值粘贴到 Teable 的 SSO 配置中
注意:你可以随时从 Credentials 页面检索这些凭据。
步骤 7:配置 OAuth 端点
在 Teable 中填写以下 OAuth 端点:
- Authorization URL(授权 URL):
https://accounts.google.com/o/oauth2/v2/auth
- Token URL(令牌 URL):
https://oauth2.googleapis.com/token
- User Info URL(用户信息 URL):
https://openidconnect.googleapis.com/v1/userinfo
- Issuer(颁发者):
https://accounts.google.com
步骤 8:测试 SSO 登录
你有两种方式启用 SSO 登录:
方式 1:直接使用认证 URL
- 直接使用授权 URL 作为你的 SSO 登录 URL
方式 2:域名验证
- 在 Teable 中配置域名验证
- 验证你的 Google Workspace 域名
- 访问 https://app.teable.io
- 点击 SSO 登录按钮
- 输入你的 Google Workspace 电子邮件地址以登录
其他配置(可选)
按域名限制访问
如果要限制对特定 Google Workspace 域名的访问:
- 在你的应用程序代码或 Teable 设置中配置域名限制
- 仅允许来自已验证域名的电子邮件地址
配置会话持续时间
- 在 Google Admin Console 中,进入 Security → Authentication
- 配置 Google session control 设置
- 设置会话持续时间和重新认证策略
启用两步验证
- 在 Google Admin Console 中,进入 Security → Authentication → 2-Step Verification
- 为你的组织启用两步验证
- 为用户配置强制策略