I have created a bare bones MVC5 / Web Api 2 website using OWIN components (beta 3.0) for the Authentication. It is using WsFederationAuthentication and pointing to our STS successfully... when we run the website the redirect works and the proper fields are shown (username, password, and one extra required field) and then we are returned to our webpage correctly and show as logged in.

What I now need to do is enable this login behavior from a desktop app (mine happens to be an Excel Addin, but an example in a console app would do just fine). I have been looking for good examples of Federated Web Api 2 authentication from a desktop app, but the only ones I am really finding are basic authentication or social media OAuth2 examples, it seems.

有帮助吗?

解决方案

Here is a blog post explaining how to do it, but since the authentication is inherently cookie based, you'd have to jump some hoops to get this cookie into your thick client.

This is bit of a hack, though. It seems that you are trying to use authentication mechanism designed for the web with a thick client. Maybe if you give some more information for the app you are building, it will help.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top