November 2015
Intermediate to advanced
152 pages
2h 46m
English
If the credentials are found to be invalid by any of the filters in the list, then it sets ErrorResult in context parameter of the AuthenticateAsync method. Instance of AuthenticationFailureResult is assigned to context with appropriate error message as follows in the AuthenticateAsync method of the filter:
// If the sufficient information for credentials not supplied. if (String.IsNullOrEmpty(authorization.Parameter)) { context.ErrorResult = new AuthenticationFailureResult("Missing credentials", request); return; } Tuple<string, string> userNameAndPasword = ExtractUserNameAndPassword(authorization.Parameter); string userName = userNameAndPasword.Item1; string password = userNameAndPasword.Item2; IPrincipal principal = ...Read now
Unlock full access