2

I have a ASP.Net application and it uses Swashbuckle and viewing the documentation all worked fine until another developer set up some authorization logic using a JWT and where "Authorization Bearer" needs to be passed in every header request. After that implementation I can't even view the documentation at /44300/swagger. It just says invalid credentials. I have the ability to generate a token hitting an /api/security endpoint but how can I configure Swashbuckle to get/use a token just to load the documentation page. This is really frustrating as I can't find any information online.

Again, I am not trying to hit endpoints through Swashbuckle. I simply want to hit the URL to view the documentation and it won't allow me to

theDoke
  • 553
  • 1
  • 7
  • 18
  • 1
    Your authorization setup is screwed up - you have to set up the swagger endpoint to be served anonymously (Bearer token should be used just for API invocations, not for documentation). However you don't provide enough info about how is your authorization set up. – Ondrej Svejdar Nov 21 '15 at 10:59
  • Ok, thanks. I would provide more info about the authorization setup, but I didn't implement it. I was tasked with just fixing the documentation afterwards. Thanks though. – theDoke Nov 21 '15 at 16:48

1 Answers1

0

As of right now swagger doe not support the Resource Owner Flow.

There is a way to get round this problem,

Have a look at the question i posed earlier this week.

SwashBuckle/Swagger - OAuth Resource Owner Password Flow

Community
  • 1
  • 1
Derek
  • 8,300
  • 12
  • 56
  • 88