如何使用自定义令牌在全球范围内验证 WCF 服务

how to Authenticate WCF service globally using custom token

我想在 wcf rest 服务中的每个服务调用上添加全局自定义令牌身份验证。 我的服务有超过 50 (Get/Post) 个方法。 现在我在每个方法中传递令牌并对它们进行身份验证,现在我想在全球范围内使用 global.asax 或路由或属性读取

谢谢

为了获得动态解决方案,我通过多个链接来了解 WCF 参数验证,我在这里找到了解决方案

Create a class that inherate IparameterInspector

IparameterInspector usesbase class as IoperationBehaviour

Add the created class to your operation contract as a Attribute

For detail descrption see the link WCF Extensibility using IParameterInspector

如果您愿意,可以评论您的查询或问题以获取我的 Get 和 Post 方法的实际代码