Vtex.Gallery.Core.VtexCredentials.CreateAuthorizationHeader C# (CSharp) Method

CreateAuthorizationHeader() public method

public CreateAuthorizationHeader ( ) : AuthenticationHeaderValue
return System.Net.Http.Headers.AuthenticationHeaderValue
        public AuthenticationHeaderValue CreateAuthorizationHeader()
        {
            if (Scheme.Equals(SupportedSchemes.Basic, StringComparison.OrdinalIgnoreCase))
                return new AuthenticationHeaderValue(
                    Scheme, Convert.ToBase64String(Encoding.ASCII.GetBytes(Username + ":" + Password)));

            if (Scheme.Equals(SupportedSchemes.Token, StringComparison.OrdinalIgnoreCase))
                return new AuthenticationHeaderValue(Scheme, Token);

            throw new InvalidOperationException(UnsupportedSchemeMessage(Scheme));
        }