1
Reply

when i trying to login get an error on my web api

Sivakumar

Sivakumar

Sep 7 2015 10:57 AM
479
Hi,
 
I am trying to login my web api using rest tool get an error  like this :
 
An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code

Additional information: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. 
 
public int ValidateAndGetMemberID(string username, string password)
{
MemberLogin ml = _DataContext.MemberLogins.SingleOrDefault(m => string.Compare(m.MemberLoginName, username, true) == 0);

if (ml != null
&& Crypto.VerifyHashedPassword(ml.Member.LoginPassword, password) == true)
return ml.Member.MemberID;

throw new InvalidCredentialException();
}
 
This is my url : http://localhost:54075/api/members/login
 
and this is my tables structure :
 
 
 
I am using Rest tool to get a values 
 
Please give a solution for that.
 
 

Answers (1)