WCF Security:Silverlight authentication for WCF service based on security token
In my previous blogs I show you how to authenticate WCF service client base on username/password. That is very available for ASP.Net client. But with Silverlight client, it is not available. THe Silverlight application is running on the remote machine of end users, it is not acceptable to transfer usename/password in cleartext in the wire. In addition, Silverlight supports BasicHttpBinding only,so security in transport level is not supported.
In order to authenticate Silverlight caller for WCF service, we need to generate a security token from username,password and a timestamp. The security token is a encrypted text, so we can transfer it over the network securely.
Then another question comes out. How can we pass in the security token in Silverlight application, and how can WCF service retrieve and validate it? The key points are System.ServiceModel.Dispatcher.IClientMessageInspector and System.ServiceModel.Dispatcher.IDispatchMessageInspector.
Create implementations for System.ServiceModel.Dispatcher.IClientMessageInspector and System.ServiceModel.Dispatcher.IDispatchMessageInspector. Respectively, these implementations will “inspect” the message before it is sent, and after it is received; It is during these steps that the header can be injected and read.
Thanks to the authors of the following blogs.
http://problog.jamespritz.com/2009/05/17/custom-headers-in-wcf.aspx
http://weblogs.asp.net/paolopia/archive/2007/08/23/writing-a-wcf-message-inspector.aspx
[@more@]來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/13651903/viewspace-1033801/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- WCF Security:authentication based on Username/Password - Part I
- WCF Services Sample: Authenticate Silverlight Client based on Custom Security Tokenclient
- WCF Services Sample: Authenticate Silverlight Client based on UserName and Passwordclient
- WCF Rest ServiceREST
- WCF、Web API、WCF REST、Web Service之區別WebAPIREST
- 構建WCF RESTful service示例REST
- Android Service SecurityAndroid
- 利用WCF建立簡單的RESTFul ServiceREST
- Kafka security-Encryption and Authentication using SSLKafka
- Silverlight同步(Synchronous)呼叫WCF服務(轉)
- [譯] Security Token 生態 — 專案指南
- Spring Security OAuth 個性化tokenSpringOAuth
- WCF、Net remoting、Web service概念及區別REMWeb
- MSMQ In WCFMQ
- WCF學習筆記(一):WCF簡介筆記
- Silverlight中利用WCF獲取客戶端IP客戶端
- WCF 的 Service Instance模式和併發處理模式
- 學習 WCF (3)--開發WCF客戶程式
- WCF筆記筆記
- WCF基礎
- WCF傳輸安全(TransferSecurity)的基本概念和原理:認證(Authentication)[上篇]
- WCF Data Service 使用小結 (一)—— 瞭解OData協議協議
- API Token AuthenticationAPI
- 在IIS8.5的環境下配置WCF的Restful ServiceREST
- WCF The service cannot be activated because it does not support ASP.NET compatibilityASP.NET
- WCF系列教程地址
- WCF配置檔案
- Security
- WCF基礎教程之開篇:建立、測試和呼叫WCF
- WCF分散式開發步步為贏(0):WCF學習經驗分享,如何更好地學習WCF?薦分散式
- ASP.NET MVC提交一個較複雜物件至WCF ServiceASP.NETMVC物件
- Silverlight中非同步呼叫WCF服務,傳入回撥函式非同步函式
- WCF雙工通訊
- C# WCF入門C#
- WCF安全指南釋出
- WCF、Socket程式設計程式設計
- Java與WCF互動(一):Java客戶端呼叫WCF服務 (轉)Java客戶端
- WCF服務端的.NET Core支援專案Core WCF 正式啟動服務端