Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Try using FormAuthentication by setting the web.config authentication section like so:</p> <pre><code>&lt;authentication mode="Forms"&gt; &lt;forms name=".ASPXAUTH" requireSSL="true" protection="All" enableCrossAppRedirects="true" /&gt; &lt;/authentication&gt; </code></pre> <p>Generate a machine key. Example: <a href="https://blogs.msdn.microsoft.com/amb/2012/07/31/easiest-way-to-generate-machinekey/" rel="nofollow noreferrer">Easiest way to generate MachineKey – Tips and tricks: ASP.NET, IIS ...</a></p> <p>When posting to the other application the authentication ticket is passed as a hidden field. While reading the post from the first app, the second app will read the encrypted ticket and authenticate the user. Here's an example of the page that passes that posts the field:</p> <p>.aspx:</p> <pre><code>&lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;p&gt;&lt;asp:Button ID="btnTransfer" runat="server" Text="Go" PostBackUrl="http://otherapp/" /&gt;&lt;/p&gt; &lt;input id="hdnStreetCred" runat="server" type="hidden" /&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p>code-behind:</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { FormsIdentity cIdentity = Page.User.Identity as FormsIdentity; if (cIdentity != null) { this.hdnStreetCred.ID = FormsAuthentication.FormsCookieName; this.hdnStreetCred.Value = FormsAuthentication.Encrypt(((FormsIdentity)User.Identity).Ticket); } } </code></pre> <p>Also see the cross app form authentication section in Chapter 5 of this <a href="http://www.wrox.com/WileyCDA/WroxTitle/Professional-ASP-NET-2-0-Security-Membership-and-Role-Management.productCd-0764596985.html" rel="nofollow noreferrer">book</a> from Wrox. It recommends answers like the ones above in addition to providing a homebrew SSO solution. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload