开发者

Silverlight loses authentication on Page Refresh

开发者 https://www.devze.com 2023-03-08 21:05 出处:网络
I am building a SL4 application that uses the standard authentica开发者_运维问答tion built into the business template. The user logs in and is then redirected to a new page. If the user then refreshes

I am building a SL4 application that uses the standard authentica开发者_运维问答tion built into the business template. The user logs in and is then redirected to a new page. If the user then refreshes that page, the WebContext.Current.User returns null. Why does this happen? Thanks


Probably, you are handling your authentication context inside the Silverlight application, and when the page is refreshed, a new Silverlight application is instantiated and therefore a new authentication context is created, on which the user has not provided credentials yet. In order to prevent this it is necessary for you to move the authentication context to an upper layer, at the browser and authenticate using a server side technology like ASP.NET and have Silverlight leverage that authentication context instead of handling its own context.

0

精彩评论

暂无评论...
验证码 换一张
取 消