Given the following configuration:
- a web client = a regular, modern browser;
- a typical ASP.NET web application, somewhere on the Internet;
- a third-party web service that:
- sits in another domain (no relation via federation, domain trust relations or so);
- cannot be touched / configured;
- is accessible via the Internet;
- is connection-less;
- requires each web request to be authenticated;
- supports a common authentication scheme (Windows) and provides a SDK that allows setting the credentials (username, password) when preparing a request.
- does not support OAuth or similar techniques, so there's no identity token that can be used instead of credentials.
The ASP.NET web application would implement most of its features by making requests to the third-party web service. Thus the web application requires the Windows credentials of its users.
The ASP.NET web application would act like a UI proxy for the 3rd-party web service. Furthermore, the 3rd-party web service is not a singleton. The web application is supposed to be a UI proxy for many instances of those 3rd-party web services (so many Windows domains). Therefore, the web application would act like a de-multiplexing UI proxy - if there is such a term :) It proxies several instances of the 3rd party web service.
Now I am beating my brains out to find a secure way of passing user's credentials (username, password) from the web client to the third-party service, via the web application :)
Where can the credentials be kept securely after the user provides them, at the beginning of a work session, until the work session ends? I though of various media such as: HTTP cookies, HTTP headers, HTML local storage, server memory, web session, application database.
With respect to the question above, what is a good way of encrypting the credentials so that they can be decrypted when required, that is, when preparing the request for the third-party web service (symmetric encryption)? All communication is HTTPS.
I know this is a weird puzzle :)
Update
Perhaps getting the 3rd-party web service to support a brokered authentication pattern (then use OAuth or something similar) would be best. Right?
Update: similar (or duplicate?) questions - seems to be a popular issue
i *must* store third party credentials in my database. best way?
How to store user password for third party service in Python?
Security model: log in to third-party site with user's credentials
Storing third-party passwords for reuse across pages
Encrypting 3rd party credentials
What's a smart way of storing user credentials for an external site (that does not use OAuth)?
Need to ephemerally store third-party password
Storing third-party auth info securely
Reversible password storage obfuscation method for third-party login credentials
storing the third party credentials in the database/some secure place