Exemple #1
0
        public Guid IssueAccessToken()
        {
            var accessToken = Guid.NewGuid();

            AccessTokens.Add(accessToken);

            return(accessToken);
        }
Exemple #2
0
        /// <summary>
        /// Add Oauth2 token to the bombardier generator
        /// </summary>
        /// <param name="token"></param>
        /// <param name="authenticationType"></param>
        /// <returns></returns>
        public BombardierGeneratorOptions AddOAuth2Token(string token, AuthenticationType authenticationType)
        {
            if (string.IsNullOrEmpty(token))
            {
                throw new ArgumentException($"{nameof(token)} is null.");
            }
            if (authenticationType == null)
            {
                throw new ArgumentException($"{nameof(authenticationType)} is null.");
            }

            AccessTokens.Add(authenticationType, token);
            return(this);
        }