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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Silverlight+WCF 簡單部署問題集
- Android Service SecurityAndroid
- WCF系列教程地址
- WCF雙工通訊
- C# WCF入門C#
- Spring Security OAuth 個性化tokenSpringOAuth
- Java與WCF互動(一):Java客戶端呼叫WCF服務 (轉)Java客戶端
- WCF服務端的.NET Core支援專案Core WCF 正式啟動服務端
- [WCF許可權控制]利用WCF自定義授權模式提供當前Principal模式
- [譯] Security Token 生態 — 專案指南
- 艾偉:WCF安全之EndPointIdentityIDE
- IIS部署WCF詳細教程
- 學習WCF之路,長期更新
- Spring security (一)架構框架-Component、Service、Filter分析Spring架構框架Filter
- WCF與ASP.NET Core效能比較ASP.NET
- 《WCF全面剖析》-章節內容簡介
- CoreWCF 1.0.0 釋出,微軟正式支援WCF微軟
- Improved Security for a Ring-Based Fully Homomorphic Encryption Scheme-2013:解讀Scheme
- spring5.0 security oauth2 token 儲存失敗SpringOAuth
- Spring SecuritySpring
- [譯]2018 年 Security Token 發展現狀及未來展望
- Spring Security原始碼分析八:Spring Security 退出Spring原始碼
- [WCF安全系列]從兩種安全模式談起模式
- Spring Security原始碼分析九:Spring Security Session管理Spring原始碼Session
- Risk Based Security三季度漏洞快報:近50%可被遠端利用
- Spring Security(二)Spring
- Spring Boot SecuritySpring Boot
- 1.1.2 Security Officers
- Content Security Policy
- Android Activtity SecurityAndroid
- Android Logcat SecurityAndroidGC
- Android Broadcast SecurityAndroidAST
- Rails Security (上)AI
- Security, Privacy and Ethics
- Spring Security + JWTSpringJWT
- Spring Security(6)Spring
- Spring Security(7)Spring
- Spring Security(8)Spring
- 初探Spring SecuritySpring