public static string ConvertToString(AuthorizationResponseType responseType)
        {
            if (!Map.TryGetValue(responseType, out var value))
            {
                throw new ArgumentException("Unknown response type.", nameof(responseType));
            }

            return(value);
        }
示例#2
0
        /// <summary>
        /// Adds a new response_type query string parameter indicating whether a code or a token must be returned.
        /// </summary>
        /// <param name="responseType">Type of the response.</param>
        /// <returns>The <see cref="AuthorizationUrlBuilder"/>.</returns>
        public AuthorizationUrlBuilder WithResponseType(AuthorizationResponseType responseType)
        {
            AddQueryString("response_type", responseType.ToString().ToLower());

            return(this);
        }