简体   繁体   中英

how to Authenticate WCF service globally using custom token

I wanted to add a global Custom token authentication on each service call in wcf rest service. My service having more than 50 (Get/Post) methods. Now I am passing token in each method and authenticate them, Now i wanted to do that globally using something like global.asax or routing or attribute reading

Thank you

For getting the dynamic solution i went through multiple links to understand WCF parameter validation and I found the solution here

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

If you want you can Comment you query or question to get my actual code for Get and Post method

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM