tailieunhanh - Professional ASP.NET 2.0 Security, Membership, and Role Management phần 5

có một vấn đề tinh tế với các tính năng và mã được gọi là khi chỉ đáng tin cậy đang trên stack. Các lớp cấu hình tùy chỉnh là một phần của vấn đề này bởi vì khi cấu hình được nạp, nó không phải là đảm bảo rằng sẽ có bất kỳ mã người sử dụng trên stack. | Forms Authentication machineKey decryptionKey A225194E99BCCB0F6B92BC9D82F12C2907BD07CF069BC8B4 validationKey 6FA5B7DB89076816248243B8FD7336CCA360DAF8 With this configuration both applications are forced to use cookieless tickets. Additionally both applications share common key information which ensures that a ticket from one application is consumable by the other application. To focus on the cross-application redirect issue we will keep the rest of the application very simple. Both applications will have a page and a login page. Both login pages for now will simply issue a forms authentication ticket for a fixed username and then pass the user back to the original requesting URL testuser false After you end up on there is a button which you can click to redirect yourself over to the other application Chapter5 cookielessAppB The preceding code is in the sample application called cookielessAppA so redirects over to the other sample application cookielessAppB. If you were to run both sample applications and try to seamlessly ping-pong between the two applications you would find yourself constantly logging in. The culprit of course is that that punts you to the other application when that redirect is issued the cookieless credentials embedded in the current URL are lost. Unfortunately you can t just call one API or use some new parameter on the Redirect method to solve this problem when running in cookieless mode. Although has logic to store a ticket on the query-string the scenario above is one where you click on a link inside of one application and it takes you over to a second application. For this case you need a wrapper around that includes the logic to pass the forms authentication ticket along with the redirection. I created a simple query-string wrapper public static class .

TỪ KHÓA LIÊN QUAN