-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Added bearer/JWT support and OpenIdConnect #807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2974,10 +2974,13 @@ Supported schemes are basic authentication, an API key (either as a header or as | |
##### Fixed Fields | ||
Field Name | Type | Validity | Description | ||
---|:---:|---|--- | ||
<a name="securitySchemeType"></a>type | `string` | Any | **Required.** The type of the security scheme. Valid values are `"basic"`, `"apiKey"` or `"oauth2"`. | ||
<a name="securitySchemeType"></a>type | `string` | Any | **Required.** The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`. | ||
<a name="securitySchemeDescription"></a>description | `string` | Any | A short description for security scheme. | ||
<a name="securitySchemeName"></a>name | `string` | `apiKey` | **Required.** The name of the header or query parameter to be used. | ||
<a name="securitySchemeIn"></a>in | `string` | `apiKey` | **Required** The location of the API key. Valid values are `"query"` or `"header"`. | ||
<a name="securitySchemeScheme"></a>scheme | `string` | `http` | **Required.** The name of the HTTP Authorization scheme to be used in the Authorization header as per RFC 7234. | ||
<a name="securitySchemeBearerFormat"></a>bearerFormat | `string` | `http` (`"bearer"`) | A hint to the client to identify how the bearer token should be formatted. | ||
<a name="securitySchemeOpenIdConnectUrl"></a>openIdConnectUrl | `string` | `openIdConnect` | **Required.** OpenId Connect URL to discover OAuth2 configuration values. | ||
<a name="securitySchemeFlow"></a>flow | `string` | `oauth2` | **Required.** The flow used by the OAuth2 security scheme. Valid values are `"implicit"`, `"password"`, `"application"` or `"accessCode"`. | ||
<a name="securitySchemeAuthorizationUrl"></a>authorizationUrl | `string` | `oauth2` (`"implicit"`, `"accessCode"`) | **Required.** The authorization URL to be used for this flow. This SHOULD be in the form of a URL. | ||
<a name="securitySchemeTokenUrl"></a>tokenUrl | `string` | `oauth2` (`"password"`, `"application"`, `"accessCode"`) | **Required.** The token URL to be used for this flow. This SHOULD be in the form of a URL. | ||
|
@@ -2995,12 +2998,14 @@ Field Name | Type | Description | |
|
||
```json | ||
{ | ||
"type": "basic" | ||
"type": "scheme", | ||
"scheme" : "basic" | ||
} | ||
``` | ||
|
||
```yaml | ||
type: basic | ||
type: http | ||
scheme: basic | ||
``` | ||
|
||
###### API Key Sample | ||
|
@@ -3019,6 +3024,22 @@ name: api_key | |
in: header | ||
``` | ||
|
||
###### JWT Bearer Sample | ||
|
||
```json | ||
{ | ||
"type": "scheme", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
"scheme" : "bearer", | ||
"bearerFormat" : "JWT", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
} | ||
``` | ||
|
||
```yaml | ||
type: http | ||
scheme: bearer | ||
bearerFormat: JWT | ||
``` | ||
|
||
###### Implicit OAuth2 Sample | ||
|
||
```json | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to assume
openIdConnect
you mean http://openid.net/connect/ ? Is that a generic protocol? Is it ok to use the name in the spec?I'm wondering if there is a more generic term to describe it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The license to use/reference OpenID related works seems pretty unrestricted http://openid.net/specs/openid-connect-discovery-1_0.html#Notices
To be more generic we could have a
IdentityProviderURL
. OpenID provides both a WebFinger protocol and a .well-known URL for getting at the OpenID configuration. If other Identity Providers come along they would probably have their own "discovery" mechanism.