Dear all,
I have two api controller and I require a little help in how can I get the following code, to allow clients to enter in any username/password and the system will direct them to correct api controller.
public class Login: IProvidePrincipal
{
private const string Username = "#####";
private const string Password = "####";
public IPrincipal CreatePrincipal(string username, string password)
{
if (username != Username || password != Password)
{
return null;
}
var identity = new GenericIdentity(Username);
IPrincipal principal = new GenericPrincipal(identity, new[] { "admin" });
return principal;
}
}
any help or advice would be most welcome.
Many thanks
Go to the complete details ...