Click here to Skip to main content
15,892,059 members
Articles / Web Development / IIS

Make ClickOnce Work With ASP.NET Forms Authentication

,
Rate me:
Please Sign up or sign in to vote.
4.36/5 (10 votes)
20 Mar 2008CPOL10 min read 140.2K   761   37  
A solution for securing access to a ClickOnce application using ASP.NET Forms authentication.
Partial Public Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim _XbapFileName As String = System.Configuration.ConfigurationManager.AppSettings.Item("SiteRoot") & System.Configuration.ConfigurationManager.AppSettings.Item("XbapFileName")
        Response.Redirect(String.Format("{0}?{1}={2}", _XbapFileName, FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(CType(Context.User.Identity, FormsIdentity).Ticket)))
    End Sub

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions