我正在使用 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.
引用文献:
关于azure - 在 Jenkins 中禁用 SSO 用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69890714/