I have a MVC .NET application that I would like to expose to our clients as an API. Can I just apply a filter to switch the serialization. I've seen examples of how to auto switch the output using action filters, but had questions on authentication.
The system currently uses forms authentication, and auto redirects if no authentication is provided.
Can I just use the authentication as is and require the client system to login, perform functionality and logout just as if they were using the system via web brows开发者_C百科er?
Depending on your authentication mechanism, you would be requiring the client to hang on to cookie values just like a browser would. It should work though. You could also implement a custom authentication filter that does token based stuff or the regular stuff depending on the client.
精彩评论