如何从MembershipProvider类获取请求的url ?

时间:2021-02-09 07:21:58

I'm currently trying to implement the MembershipProvider class, but my user repository isn't typical to most of the examples I'm finding on the net. Instead of retrieving a user, we simply check the user's identity against an auth server for the requested URL:

我目前正在尝试实现MembershipProvider类,但是我的用户存储库并不是我在网络上找到的大多数示例的典型。我们只是简单地检查用户的身份,而不是检索用户,而不是检索用户的身份。

  • User attempts to "POST" to ws.example.com/jobA
  • 用户试图“发布”到ws.example.com/jobA。
  • Attribute validates the user with the auth server to see if they have access to this action/url
  • 属性验证用户与auth服务器是否访问此操作/url。
  • Rejects or accepts the request
  • 拒绝或接受请求。

A couple other posts pointed me in this direction for implementing a custom membership provider. The way I figure it, in order to make this work, I need to be able to see what the requested URL was, and be able to look at their cookies. In Filters, i have access to the HttpRequestMessage. How do I get at the info i need in this context??

还有一些其他的文章指出我在这个方向上实现了自定义的成员资格提供程序。我的计算方法是,为了完成这项工作,我需要能够看到请求的URL是什么,并且能够查看他们的cookie。在过滤器中,我可以访问HttpRequestMessage。我如何得到我在这方面需要的信息?

1 个解决方案

#1


0  

[Despite this thread is not specifically about SharePoint Membership Providers, I will just leave this solution here because I couldn't find it anywhere else, and kept being redirect to this thread while looking for solutions on Google. I hope it helps someone]

[尽管这个线程不是关于SharePoint成员提供者的,我还是把这个解决方案留在这里,因为我在其他地方找不到它,并且在寻找谷歌的解决方案时,一直被重定向到这个线程。我希望它能帮助别人。

For SharePoint Membership Providers, we have the Security Token Service, which is a WCF Service. In this case, System.Web.HttpContext.Current is always null, but you can get the actual Request URL using this property:

对于SharePoint成员提供者,我们有安全令牌服务,这是一个WCF服务。在这种情况下,System.Web.HttpContext。当前总是null,但您可以使用此属性获得实际的请求URL:

 System.ServiceModel.OperationContext.Current.RequestContext

#1


0  

[Despite this thread is not specifically about SharePoint Membership Providers, I will just leave this solution here because I couldn't find it anywhere else, and kept being redirect to this thread while looking for solutions on Google. I hope it helps someone]

[尽管这个线程不是关于SharePoint成员提供者的,我还是把这个解决方案留在这里,因为我在其他地方找不到它,并且在寻找谷歌的解决方案时,一直被重定向到这个线程。我希望它能帮助别人。

For SharePoint Membership Providers, we have the Security Token Service, which is a WCF Service. In this case, System.Web.HttpContext.Current is always null, but you can get the actual Request URL using this property:

对于SharePoint成员提供者,我们有安全令牌服务,这是一个WCF服务。在这种情况下,System.Web.HttpContext。当前总是null,但您可以使用此属性获得实际的请求URL:

 System.ServiceModel.OperationContext.Current.RequestContext