Search code examples
asp.net-mvcauthorizationform-authentication

Site Login via Access Codes


I need to semi-secure(meaning people could give these access codes away, and it will work for anyone) a site using access codes, no username or passwords, just a 5 digit access codes. But I would want to be able to still use the [Authorize] functionality. I believe I will I can't use the default membership (as its not really a membership), any ideas on how to approach this?


Solution

    1. Use the standard SQL Membership providers.
    2. Use your 5-digit access code as the username
    3. Hardcode a default password in your controllers (so the user interface never sees it).

    Caution should be used because this is very unsecure.