标签: identity-delegation

联合与委派,OAuth与OpenID Connect与SAML

我试图了解联合身份验证和委托身份验证之间的差异,但我越来越困惑.

  1. 我们是否始终使用SAML协议进行联合身份验证?或者是什么?

  2. 是否可以将OpenID Connect(或OAuth)用于两种身份验证方法?

  3. 我们是否需要在两个域之间建立Trusted连接才能进行委托或联合身份验证?

  4. 我们是否始终将SAML用于合作伙伴,将OpenID Connect(或OAuth)用于客户?

  5. 如果有人在两个域(合作伙伴和企业)之间解释这两种身份验证方法的不同步骤,我将不胜感激.

identity federated-identity oauth-2.0 identity-delegation openid-connect

7
推荐指数
1
解决办法
1535
查看次数

将线程的上下文更改为其他用户

用户触发事件,因此线程在所述用户的上下文中.我遍历所有连接的用户并希望向他们发送此事件,但我想使用经典授权来确定他们是否应该接收该事件.问题是线程主体等是在触发事件的用户的上下文中.

我正在考虑模仿线程,然后进行授权.我发现了这篇文章

http://msdn.microsoft.com/en-us/library/ff647248.aspx#ImpersonationDelegation5

using System.Security.Principal;
…
WindowsIdentity wi = new WindowsIdentity(userName@fullyqualifieddomainName);
WindowsImpersonationContext ctx = null;

try
{
  ctx = wi.Impersonate();
  // Thread is now impersonating you can call the backend operations here...

catch
{
  // Prevent exceptions propagating.
}
finally
{
  // Ensure impersonation is reverted
  ctx.Undo();
}
Run Code Online (Sandbox Code Playgroud)

之后ctx = wi.Impersonate();的线程仍然在主叫用户的情况下,我究竟做错了什么?

更新 我想以其他用户身份运行此代码

provider = AuthorizationFactory.GetAuthorizationProvider();
provider.Authorize(Thread.CurrentPrincipal, Rule)
Run Code Online (Sandbox Code Playgroud)

我做的一个小博客,涵盖了所需的步骤 http://andersmalmgren.com/2014/06/12/client-server-event-aggregation-with-role-authorization/

c# impersonation windows-identity identity-delegation

5
推荐指数
1
解决办法
2233
查看次数