So, I'm building a site that needs to access a database which was created originally for asp.net. I want to use the same username and password as the asp.net site used, which is already in the database. The developer mentioned that the default authentication was used in asp.net.
Example Password from the database: sYWPXNvJlVNs8EVZvIQOSaWfQ4I=
Example PasswordSalt from the database: ruNTdhelY57ghQsTFz/TIg==
Here is what I have tried:
<cfquery name="auth" datasource="ct">
SELECT userid, Password, PasswordSalt from dbo.aspnet_Membership
WHERE userid = '#auth1.userid#'
</cfquery>
<cfset cfHash = toBase64(hash(auth.PasswordSalt & cookie.password, "SHA1"))>
<cfif cfHash eq auth.Password> ...then authenticate etc.
I've tried a few iterations of this, but no go, the resulting cfHash ends up too long, like this:
OUJBOUJENjI0MzEzNjM3M0EwQjk3Nzc3ODIzNUVGMkJCODczOEI0Qg==
Any ideas?