diff --git a/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIOptions.cs b/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIOptions.cs index d0a479e317..0c30cc59d3 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIOptions.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIOptions.cs @@ -192,6 +192,7 @@ public class OAuthConfigObject /// /// Default clientSecret /// + /// Setting this exposes the client secrets in inline javascript in the swagger-ui generated html. public string ClientSecret { get; set; } = null; /// diff --git a/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIOptionsExtensions.cs b/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIOptionsExtensions.cs index 7c3cad1a4e..d884b6cde6 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIOptionsExtensions.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIOptionsExtensions.cs @@ -236,8 +236,9 @@ public static void OAuthUsername(this SwaggerUIOptions options, string value) /// /// /// + /// Setting this exposes the client secrets in inline javascript in the swagger-ui generated html. public static void OAuthClientSecret(this SwaggerUIOptions options, string value) - { + { options.OAuthConfigObject.ClientSecret = value; }