Closed
Description
We want to use swagger for an internal system. The authentication mechanism we use is Kerberos.
Currently this is not a supported type value of the Security Scheme Object.
To support Negotiate (for Kerberos), NTML or Digest (as values for the WWW-Authenticate-Header) it would be nice if the type values would be added to the specification.
Activity
webron commentedon Aug 28, 2015
What additional fields would be required to support Kerberos or other schemes you had in mind? As you can see in the spec,
basic
has no additional metadata,apiKey
has the name of the field and where it's located,oauth2
has the flow type and based on the flow the additional token urls.lennybacon commentedon Aug 28, 2015
Digest, NTLM and Negotiate work like basic (RFC 2617 contains basic and digest http://www.ietf.org/rfc/rfc2617.txt)
in HTTP its
As you said is swagger basic has no additional metadata. So as far as I can see it's just adding the values
digest
,ntml
,negotiate
as allowed for types of the Security Scheme Object.webron commentedon Aug 28, 2015
I wonder whether we should just add those as types or possibly group them all under the
access
type and have another field specifying the specific type. Don't know if there are any benefits to either approach (though my suggestion is more verbose).As a side note, and possible workaround for now, you can use vendor extensions to specify the specific type. Just set it to type basic, and add something like
x-extended-type: digest
.lennybacon commentedon Aug 28, 2015
I think we are already at the right place as OAUTH uses the same mechanism to authenticate (when headers are used) and should just add them:
lennybacon commentedon Aug 28, 2015
And as we are on the authentication topic... What about client certificates? Had that in mind yet? If not we should consider to include it when extending the auth types.
dolmen commentedon Feb 29, 2016
Related: #583
webron commentedon Feb 29, 2016
How is #583 related to this and not a duplicate of this?
dolmen commentedon Mar 1, 2016
@webron This ticket is about Kerberos and WWW-Authenticate header. #583 is about the Authorization header.
They are different use cases but they are related as ideally a single common solution could fix both.
As a user I don't think it is my task to decide when tickets must be grouped because I don't have your global vision of the issues.
webron commentedon Mar 1, 2016
@dolmen of course, I much rather people open new issues than not comment at all. If issues are related, it may make sense to expand the discussion on the issue rather than open a new ticket, but either works - it's no big deal most of the times.
Sometimes the differences are not clear - was just checking how the issues differ 😉
webron commentedon Mar 1, 2016
Parent issue: #585
darrelmiller commentedon Oct 8, 2016
The pr #807 now allows you to specific the scheme in the security definition, so you can specify the
negotiate
scheme.webron commentedon Mar 3, 2017
Closing as done.
23 remaining items
MikeRalphson commentedon Dec 19, 2018
Apologies for leaving you hanging, though the swagger-ui repository would probably be the best place to ask, I don't believe Kerberos is supported in swagger-ui's Try It Out console today. Though there might be a hook you could use to implement it...
lennybacon commentedon Dec 19, 2018
I just looked at the repo and from the code I guess it will not work. For basic they have a username and password field which means they stuff the header by themselves: https://github.com/swagger-api/swagger-ui/blob/12e350fcad66f7708e6bc3e18d8cb2c9a107bc16/src/core/components/auth/basic-auth.jsx
keith6014 commentedon Dec 22, 2018
@MikeRalphson
No problem! Thanks for the idea and keep up the good work.
@lennybacon
yeah, doesn't seem so. Thanks for looking.
Kerberos/SSO is the single most feature most of our user base has required. I will consider asking swagger-ui group https://github.com/swagger-api/swagger-ui
MikeRalphson commentedon Dec 22, 2018
We're actively looking at security improvements for v3.1 so let us know if Kerberos / SSO needs further support in the spec.
keith6014 commentedon Dec 22, 2018
Yes. Kerberos is needed. Its used quite heavily in the world. So far in the 3 large companies I worked for Kerberos was the primary auth method.
MikeRalphson commentedon Dec 22, 2018
Technically, the spec supports it today, but tooling is free to support whichever auth schemes they want. But do we require any new metadata fields to make support actually work?
stevendearborn commentedon Feb 5, 2019
According to the OAS 3.0.2 documentation, all of the IANA-registered HTTP authentication schemes are supported, with the qualification as to this relates to the authorization header. As posted on Feb 9, 2018 these are not supported by the Swagger Editor or UI tooling as was mentioned. Also, the 'in' property is not valid when type is set to 'http'; only scheme is valid. Presently, the only option is to use type: http, scheme: Custom, use vendor extensions (i.e. x-) to stipulate the remainder of the security scheme, and write a very clear description for application developers. There is a lot of work to be done here, potentially modifying the OAS 3.x JSON schema but mostly the tooling.
I would like to open another issue to expand the concept of 'security scheme' not to just authentication and authorization but to other security schemes such as data integrity/digital signature, non-repudiation, PKI/digital certificates, etc.. This would create a more 'normalized' JSON schema structure in the OAS specification while allowing flexibility in the tooling implementations. In absence of defining security schemes for these, the concepts, and related input and output parameters are becoming conflated with the actual resource-related inputs and outputs. The separation of these concepts would make APIs more readable especially when the complexities of API security are required.
MikeRalphson commentedon Feb 5, 2019
Some work on exactly this is being undertaken at the moment. Probably the best thing is to join one of the Thursday open TSC calls if the time works for you, or I can dig out a link to a recording of a previous call where the work-in-progress was presented.
stevendearborn commentedon Feb 5, 2019
Thank you @MikeRalphson yes I would be interested.
MikeRalphson commentedon Feb 6, 2019
@stevendearborn https://zoom.us/recording/share/PBwsPKe6OprJMcAx6bWs5Y4ySGOGnOsu7-hZGAoTS2uwIumekTziMw
lennybacon commentedon May 12, 2020
As I read here swagger 3 DOES support Kerberos: