You must authorize your personal access token (classic) after creation before the token can access an organization that uses SAML single sign-on (SSO). Access to internal
resources (repositories, projects, and packages) in an enterprise requires an SSO authorization for an organization within an enterprise. For more information about creating a new personal access token (classic), see 管理个人访问令牌. Fine-grained personal access tokens are authorized during token creation, before access to the organization is granted.
注意
如果你拥有某一组织的链接标识,则只能通过该组织使用授权的 personal access token 和 SSH 密钥,即使未强制执行 SAML 也是如此。 如果已通过 SAML SSO 对某一组织进行了身份验证,你则拥有该组织的链接标识,除非组织或企业所有者后来撤销了该链接标识。 有关撤销链接标识的详细信息,请参阅 查看和管理成员 SAML 对组织的访问权限 和 查看和管理用户对企业的 SAML 访问。
在可以授权 personal access token 或 SSH 密钥之前,必须拥有一个链接的 SAML 标识。 如果你是已启用 SAML SSO 的组织的成员,则可以至少通过使用 IdP 向组织进行一次身份验证来创建链接标识。 有关详细信息,请参阅“About authentication with single sign-on”。
授权 personal access token 或 SSH 密钥后,令牌或密钥将保持已授权状态,直到以下列方式之一撤销。
- 组织或企业所有者撤销授权。
- 你已从组织中移除。
- 已编辑 personal access token 中的范围,或重新生成了令牌。
- personal access token 在创建期间已按定义过期。
-
在 GitHub 任意页面的右上角,单击个人资料照片,然后单击 “设置”****。
-
在左侧边栏中,单击“ 开发人员设置”。
-
在左侧边栏中,单击“Personal access token”。
-
Next to the token you'd like to authorize, click Configure SSO. 如果没有看到“配置 SSO”,请确保已通过 SAML IdP 至少进行了一次身份验证,以访问 GitHub 上的资源。 有关详细信息,请参阅“About authentication with single sign-on”。
-
In the dropdown menu, to the right of the organization you'd like to authorize the token for, click Authorize.