Swagger-ui authentication

I want to use swagger to debug my api, but i do not know how to authentication at first.

Response Code
401
Response Headers
{
“date”: “Sat, 18 Jul 2015 12:06:33 GMT”,
“www-authenticate”: “credentials realm=”/auth/credentials"",
“server”: “Microsoft-IIS/8.0”,
“x-aspnet-version”: “4.0.30319”,
“x-powered-by”: “ServiceStack/4.042 Win32NT/.NET, ASP.NET”,
“vary”: “Accept”,
“access-control-allow-methods”: “GET, POST, PUT, DELETE, OPTIONS”,
“access-control-allow-origin”: “*”,
“cache-control”: “private”,
“x-miniprofiler-ids”: “[“fa71d9de8e374ae1861122245b30b3bb”,“c081351cacf749cd97c4b63aee89b3f7”,“86f3a9f5575e4bdf9898b7216dcb3f18”,“1975f2b7edae430c8faf81a2a5720993”,“5bef3c42fed7438d9832903d4bca2323”,“6522ae09d11e47578fcea48f88f94027”,“23dda253a3204e8d881bdb0f1415e0b3”,“8f784b96773041c1912a01c3850c20ed”,“6b9513eb3e8244208acd7c5cf8af6adb”,“159c8db9352b441f8ebf0dc06197604d”,“83ea003cee1d4cd1846150e8eb22049c”,“ec85a3e2537d4aa69804d23446bb0448”,“69aaca81774e417f872f81f64ba0754c”,“66e5d2e90f7b4fb48fb2741f59173924”,“fecb3bc294b94bee9d1c5dafb340399d”,“2104dbaa70bd49148fa910e9043f7ce2”,“20898dedc03f4872b37c26eadd614ce6”,“0a2d3584990741849acc2bb9f40b3680”,“83d57a8d28eb43d981071885902d988b”,“cc5ece3975604c92a890ae28aecd2553”,“927a67e1c2c44d3a82a9a80d67ecfb02”,“43b68dbed52b47fc9f2b0e7a1d813ea5”,“fea6e39e209f47928faaa8c1352cc458”,“3295fb9725f740b2b6775c09685646f4”,“c489241b43794a229c7a69bc59602094”,“0ab42662c5154ffaa5a27a58bf193050”,“792997e0fe5848da9cacdd217302a682”,“b818c320b3e94aee9b7f4062777aeaa1”,“b24cdb02fa0548eaa603263c631bcb14”,“27ac03d3d3674c8c99562ada500aa365”,“77a0072e8292460bb9957b46e7c1aef3”,“41ac247d4b8e4392b414cfade4d6173e”,“3fffc1fd7eb64345b77aceace1844887”,“8252984c60aa4d088086c5a526afbc18”,“33db4ddb99aa45a48a7ea80452ebcac9”,“7dc11d2a519b4e939890a76202f37b79”,“cae67b82b2b74af4af6c954c8178f560”,“afed2666373449a8a94d89b343bce433”]”,
“x-sourcefiles”: “=?UTF-8?B?QzpccHJvamVjdHNcQmFieUJ1c1NlcnZpY2VTdGFja0FwaVxCYWJ5QnVzU1NBcGlcQmFieUJ1c1NTQXBpXEJhYnlCdXNTU0FwaVxjaXRpZXM=?=”,
“access-control-allow-headers”: “Content-Type”,
“content-length”: “0”
}

Have you actually tried authenticating first, i.e. before using Swagger UI?

I click authentication in the swagger but it’s not response.

Try Authenticating before using Swagger UI. i.e.

/auth/credentials?Username=xxx&Password=xxx

Hi,

I was facing same problem, till I found this post.
But I was thinking, what is the function of the UserName Password form fields on top? I was thinking that I had to put in my uid/pwd there and then tap “explore” to get my secured results.

That adds the UserName/Password for HTTP Basic Auth so you’d need new BasicAuthProvider() enabled.