Beispiel #1
0
        private static string GetOauth2AuthenticationHeader(Dictionary <AuthenticationType, string> accessTokens, AuthenticationType authenticationType)
        {
            string authHeader;

            if (accessTokens.ContainsKey(authenticationType))
            {
                accessTokens.TryGetValue(authenticationType, out var value);
                authHeader = $" -H \"Authorization: Bearer {value}\"";
            }
            else
            {
                throw new QAToolKitBombardierException($"One of the access token is missing (AuthenticationType {authenticationType.Value()} required).");
            }

            return(authHeader);
        }