bingles
bingles

Reputation: 12203

ASP.NET Web API Forms Authentication Sub Application

I have 2 ASP.NET MVC web applications setup under the same domain. One is just a standard MVC website. The other is a Web API project. For now I am just setup locally.

* http://localhost/myapp
* http://localhost/api

I am using forms authentication to login in to the web application and then accessing the api application via a jQuery $.get request. Is there a way to share the forms authentication from the web app with the API app? Again these are 2 separate applications but are sharing the same root domain.

Upvotes: 1

Views: 888

Answers (1)

bingles
bingles

Reputation: 12203

I found the answer. I just needed to add a matching machineKey element to the web.config file for both of my applications.

<machineKey validationKey="..."
            decryptionKey="..."
            validation="SHA1"
            decryption="AES"
            />

Upvotes: 2

Related Questions