安全机制 – 身份传递身份信息如何传递给后台服务?Browser-Based(自动)Windows AuthenticationASP.NET Form Authentication/CookiesMessage-Based (手工)URL 参数消息头包含Username/Password 或Token
20.
Browser-Based Authentication Example with Cookies + Forms AuthE.g.: ASP.NET loginUser:Password:CredentialsYourDomain.comAuth info (cookie)Service calls + Auth infoBrowser
21.
Browser-Based Authentication Login throughSilverlightYourDomain.comCall with credentials toASP.NET Auth Service User:Password:ASP.NET Auth ServiceReply contains cookieService calls + Auth infoBrowser
22.
Browser-Based Authentication Using Windows AuthenticationWindows loginUser:Password:YourDomain.comService calls + CredsBrowser
23.
Browser-Based Authentication: Cross-DomainThreatMyBank.com LoginUser:Password:CredentialsMyBank.comAuth info (e.g. cookie)Could steal orchange dataif protection wasn’t in place恶意请求 + Auth info恶意程序恶意网站
安全机制 – 认证和授权服务端如何认证和授权?Message-Based 身份if(!OperationContext.Current.ServiceSecurityContext.PrimaryIdentity.IsAuthenticated) throw new SecurityException();// 标准 WCF方法Browser-Based 身份if(!HttpContext.Current.User.Identity.IsAuthenticated) throw new SecurityException();// ASP.NET Membership