commit
This commit is contained in:
@@ -22,9 +22,20 @@
|
||||
' .in = "header",
|
||||
' .description = "access token",
|
||||
' .required = True,
|
||||
' .type = "string"
|
||||
' .type = "string",
|
||||
' .[default] = "Bearer "
|
||||
' })
|
||||
' End If
|
||||
|
||||
' End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'End Class
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -35,8 +35,12 @@ Public Class SwaggerConfig
|
||||
' scopes.Add("read", "Read access to protected resources")
|
||||
' scopes.Add("write", "Write access to protected resources")
|
||||
' End Function)
|
||||
c.BasicAuth("basic").Description("Basic HTTP Authentication")
|
||||
'c.BasicAuth("basic").Description("Basic HTTP Authentication")
|
||||
|
||||
'c.ApiKey("apiKey").Description("API Key Authentication").Name("apiKey").In("header")
|
||||
|
||||
c.OperationFilter(Of AddAuthorizationHeaderParameterOperationFilter)()
|
||||
'c.OperationFilter(Of AddAuthTokenHeaderParameter)()
|
||||
|
||||
|
||||
'c.IncludeXmlComments($"{AppDomain.CurrentDomain.BaseDirectory}\bin\MyApi.XML")
|
||||
@@ -46,6 +50,7 @@ Public Class SwaggerConfig
|
||||
c.DocumentTitle(descr)
|
||||
c.EnableDiscoveryUrlSelector()
|
||||
c.DocExpansion(DocExpansion.Full)
|
||||
c.EnableApiKeySupport("apiKey", "header")
|
||||
|
||||
'c.EnableOAuth2Support(clientId:="test-client-id", clientSecret:=Nothing, realm:="test-realm", appName:="Swagger UI", additionalQueryStringParams:=New Dictionary(Of String, String)() From {
|
||||
' {"foo", "bar"}
|
||||
|
||||
@@ -59,7 +59,7 @@ Public Module WebApiConfig
|
||||
Dim constraintsResolver = New DefaultInlineConstraintResolver()
|
||||
constraintsResolver.ConstraintMap.Add("apiVersion", GetType(ApiVersionRouteConstraint))
|
||||
config.MapHttpAttributeRoutes(constraintsResolver)
|
||||
'config.Filters.Add(New AuthorizeAttribute)
|
||||
config.Filters.Add(New AuthorizeAttribute) 'wenn alle API Aufrufe autorisiert werden müssen!
|
||||
|
||||
|
||||
config.AddApiVersioning(Function(options)
|
||||
|
||||
Reference in New Issue
Block a user