azure - 在 Jenkins 中禁用 SSO 用户

标签 azure jenkins active-directory single-sign-on

我正在使用 Jenkins 设置 Azure AD 来引导用户

我有这样的设置和工作,但试图了解如何处理员工被解雇的情况。

我想确保他们不再有权访问 Jenkins ,但是在测试此场景后,他们不再有权登录,但如果他们已经登录,他们仍然可以访问。

如果他们已经登录,是否有办法阻止访问?

最佳答案

由于 token 有一定的过期时间,并且会不时生成刷新 token ,直到过期。尝试使用 powershell 命令撤销用户刷新 token 。

1.  Connect-AzureAD

2.  $ObjectId=(Get-AzureADUser -All 1| where {$_.UserPrincipalName -like "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="520a0a0a120a0a0a0a7c1d3c1f3b31203d213d34267c313d3f" rel="noreferrer noopener nofollow">[email protected]</a>"}).ObjectId

3.  Revoke-AzureADUserAllRefreshToken -ObjectId "$ObjectId"

(如果您不知道upn,您可以直接从用户配置文件中复制对象ID)

或者您可以在第一个命令后使用Revoke-AzureADSignedInUserAllRefreshToken

Note : This may clear current browser active sessions and may not be all and takes couple mins to come to action.

引用文献:

  1. Forcefully revoke azure ad user session | scomandothergeekystuff.com (或)

    kill all active user sessions in any azure ad office 365 application | exchangekb.com

  2. msal-net-clear-token-cache | MSDocs

关于azure - 在 Jenkins 中禁用 SSO 用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69890714/

相关文章:

c# - 使用 DHCP 从 IP 获取 mac 地址?

c# - Azure 通知中心。远程服务器返回错误: (404) Not Found.找不到NotificationId

azure - Azure APIM 是否支持 GraphQL?

wcf - WcfAzureSamples 上缺少 Microsoft.ServiceHosting.ServiceRuntime

linux - 无法远程连接到在 Debian 8 VM 上运行的 Jenkins

powershell - 使用PowerShell查询AD以匹配二进制数据

azure - 如何使用 azurerm_virtual_machine_scale_set_extension 中的设置

Jenkins 在带有生成报告的 docker 容器中构建

maven - 使用 clean 重新运行失败的 Jenkins 构建

java - 使用 Java 对 Active Directory 进行 NTLM 身份验证