Hi,
How can I add authentication to swagger for dotnet core application (the version that comes with angular2)? I need to test the api, but the requests are not authorized...
Thanks, Payman
4 Answer(s)
-
0
Hi,
Please see this document <a class="postlink" href="http://aspnetboilerplate.com/Pages/Documents/Swagger-UI-Integration#aspnet-core">http://aspnetboilerplate.com/Pages/Docu ... spnet-core</a>. It explanins how to add csrfToken to swagger requests. You need to add auth token just like the csrfToken explained in the document.
-
0
Hi,
Angular2 Web.Host project has no wwwroot\swagger\ui\index.html. What can I do?
Thanks, Payman
-
0
I added the index file, but still I'm now clear how to do it.... Suppose I have a username and password, how can I get token from it? How can I enable authorization for swagger then? Do I need to add any security definition to AddSwaggerGen?
-
0
Hi,
Sorry, I think I missunderstand you. Can you check this answer and see if it fits your case ? #2258@f0545ef1-23f7-4fb2-bafe-3afc7899b995