It's not hard to modify the forms authentication login process so that in addition to normal forms authentication, a WebClient object does basic authentication to the api/token url served by a Web Api DAL set up with Thinktecture IdentityModel. The returned session token can then be stored in the Session dictionary for later use when calling the DAL.
The problem is that these tokens have different lifespans.
I could rewrite the app to keep credentials in localStorage for use recreating the session token as required, but that's ugly and not ideal from a security perspective.
Possibly there are ways to configure token durability for one or both of these systems, but I don't know what search terms to use (I tried searching for token durability and token lifespan but the results weren't helpful).
I'm interested in both philosophical and pragmatic suggestions on how best to coordinate the two types of web app security. I'd be very surprised if there weren't already answers on this topic, if only I knew what to search for.
A little background, since some folks aren't clear on what I'm asking.
There's a big ugly old school ASP.NET web app that uses forms-based security
I've just added new stuff as a separate DAL app that uses Thinktecture IdentityModel. This DAL is used by two apps, the ASP.NET app and a Durandal SPA.
They use the same database for credential checking so they have the same identity space.
I have modified the old app's login process so that it also presents credentials to and obtains a session token from Thinktecture IdentityModel. This token is put into the Session collection to be presented whenever the old app calls into the DAL.
If you start the old app, authenticate, do stuff and close the browser, then later reopen the browser, you have a logged in ASP.NET app without login occurring so there's no opportunity to create the session token. This is the problem. I need the two tokens to have the same lifecycle.
I've thought of one possible approach. I'm presenting it below as an answer so people can express their opinions on its merits or make refinement suggestion comments. If I think of any other ideas I'll throw them up as answers, and I hope you'll do the same.