Created
July 23, 2019 07:53
-
-
Save ntakouris/fe7cb189d8ed120da2451565e673eabc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services.AddSwaggerGen(x => | |
| { | |
| x.SwaggerDoc("v1", new OpenApiInfo{ Title = "Tweetbook API", Version = "v1" }); | |
| x.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme | |
| { | |
| Description = "JWT Authorization header using the bearer scheme", | |
| Name = "Authorization", | |
| In = ParameterLocation.Header, | |
| Type = SecuritySchemeType.ApiKey | |
| }); | |
| x.AddSecurityRequirement(new OpenApiSecurityRequirement | |
| { | |
| {new OpenApiSecurityScheme{Reference = new OpenApiReference | |
| { | |
| Id = "Bearer", | |
| Type = ReferenceType.SecurityScheme | |
| }}, new List<string>()} | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment