Beispiel #1
0
        public static bool TryParse(HttpRequest request, out BasicAuthCredentials credentials)
        {
            var authHeader = AuthenticationHeaderValue.Parse(request.Headers["Authorization"]);
            var bytes      = Convert.FromBase64String(authHeader.Parameter);

            credentials = Parse(Encoding.UTF8.GetString(bytes));
            return(credentials is {});
 public static AuthenticationHeaderValue ToAuthenticationHeaderValue(this BasicAuthCredentials credentials)
 {
     return(new AuthenticationHeaderValue("Basic", credentials.Encoded));
 }