I have an web service call where I get a list of 5 access codes, a user will be able to login with one of those codes(basically feel special that they have the code, but nothing secure about it, as they could share codes if they wanted to)
I would want to be able to use the [Authorize] if at all possible. Won't be using a database, just that one api call. Is this possible?
Check the codes on login with a simple if statement
if{code1 == "edgwreggw" || code2 == "etgwg"....)
{
FormsAuthentication.RedirectFromLoginPage(data.username, true);
}
else
{
login fail
}
Webconfig
<authentication mode="Forms">
<forms loginUrl="~/UserAuthentication/SignIn" timeout="10" defaultUrl="~\Home\Index" />
</authentication>