feat: jwt as idp (#2363)

* feat: jwt idp

* feat: command side

* feat: add tests

* fill idp views with jwt idps and return apis

* add jwtEndpoint to jwt idp

* begin jwt request handling

* merge

* handle jwt idp

* cleanup

* fixes

* autoregister

* get token from specific header name

* error handling

* fix texts

* handle renderExternalNotFoundOption

Co-authored-by: fabi <fabienne.gerschwiler@gmail.com>
This commit is contained in:
Livio Amstutz
2021-09-14 15:15:01 +02:00
committed by GitHub
parent 4e1d42259c
commit b6b5b1b782
54 changed files with 2575 additions and 71 deletions

View File

@@ -118,6 +118,18 @@ Adds a new oidc identity provider configuration the IAM
POST: /idps/oidc
### AddJWTIDP
> **rpc** AddJWTIDP([AddJWTIDPRequest](#addjwtidprequest))
[AddJWTIDPResponse](#addjwtidpresponse)
Adds a new jwt identity provider configuration the IAM
POST: /idps/jwt
### UpdateIDP
> **rpc** UpdateIDP([UpdateIDPRequest](#updateidprequest))
@@ -182,6 +194,19 @@ all fields are updated. If no value is provided the field will be empty afterwar
PUT: /idps/{idp_id}/oidc_config
### UpdateIDPJWTConfig
> **rpc** UpdateIDPJWTConfig([UpdateIDPJWTConfigRequest](#updateidpjwtconfigrequest))
[UpdateIDPJWTConfigResponse](#updateidpjwtconfigresponse)
Updates the jwt configuration of the specified idp
all fields are updated. If no value is provided the field will be empty afterwards.
PUT: /idps/{idp_id}/jwt_config
### GetDefaultFeatures
> **rpc** GetDefaultFeatures([GetDefaultFeaturesRequest](#getdefaultfeaturesrequest))
@@ -1165,6 +1190,35 @@ This is an empty request
### AddJWTIDPRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| name | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| styling_type | zitadel.idp.v1.IDPStylingType | - | enum.defined_only: true<br /> |
| jwt_endpoint | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| issuer | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| keys_endpoint | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| header_name | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| auto_register | bool | - | |
### AddJWTIDPResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| details | zitadel.v1.ObjectDetails | - | |
| idp_id | string | - | |
### AddMultiFactorToLoginPolicyRequest
@@ -2851,6 +2905,32 @@ This is an empty request
### UpdateIDPJWTConfigRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| idp_id | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| jwt_endpoint | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| issuer | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| keys_endpoint | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| header_name | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
### UpdateIDPJWTConfigResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| details | zitadel.v1.ObjectDetails | - | |
### UpdateIDPOIDCConfigRequest

View File

@@ -22,6 +22,7 @@ title: zitadel/idp.proto
| styling_type | IDPStylingType | - | |
| owner | IDPOwnerType | - | |
| [**oneof**](https://developers.google.com/protocol-buffers/docs/proto3#oneof) config.oidc_config | OIDCConfig | - | |
| [**oneof**](https://developers.google.com/protocol-buffers/docs/proto3#oneof) config.jwt_config | JWTConfig | - | |
| auto_register | bool | - | |
@@ -90,6 +91,20 @@ title: zitadel/idp.proto
### JWTConfig
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| jwt_endpoint | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| issuer | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| keys_endpoint | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| header_name | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
### OIDCConfig
@@ -162,7 +177,8 @@ authorization framework of the identity provider
| Name | Number | Description |
| ---- | ------ | ----------- |
| IDP_TYPE_UNSPECIFIED | 0 | - |
| IDP_TYPE_OIDC | 1 | PLANNED: IDP_TYPE_SAML |
| IDP_TYPE_OIDC | 1 | - |
| IDP_TYPE_JWT | 3 | PLANNED: IDP_TYPE_SAML |

View File

@@ -2595,6 +2595,18 @@ Provider must be OIDC compliant
POST: /idps/oidc
### AddOrgJWTIDP
> **rpc** AddOrgJWTIDP([AddOrgJWTIDPRequest](#addorgjwtidprequest))
[AddOrgJWTIDPResponse](#addorgjwtidpresponse)
Add a new jwt identity provider configuration in the organisation
POST: /idps/jwt
### DeactivateOrgIDP
> **rpc** DeactivateOrgIDP([DeactivateOrgIDPRequest](#deactivateorgidprequest))
@@ -2659,6 +2671,18 @@ Change OIDC identity provider configuration of the organisation
PUT: /idps/{idp_id}/oidc_config
### UpdateOrgIDPJWTConfig
> **rpc** UpdateOrgIDPJWTConfig([UpdateOrgIDPJWTConfigRequest](#updateorgidpjwtconfigrequest))
[UpdateOrgIDPJWTConfigResponse](#updateorgidpjwtconfigresponse)
Change JWT identity provider configuration of the organisation
PUT: /idps/{idp_id}/jwt_config
@@ -3117,6 +3141,35 @@ This is an empty request
### AddOrgJWTIDPRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| name | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| styling_type | zitadel.idp.v1.IDPStylingType | - | enum.defined_only: true<br /> |
| jwt_endpoint | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| issuer | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| keys_endpoint | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| header_name | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| auto_register | bool | - | |
### AddOrgJWTIDPResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| details | zitadel.v1.ObjectDetails | - | |
| idp_id | string | - | |
### AddOrgMemberRequest
@@ -7343,6 +7396,32 @@ This is an empty request
### UpdateOrgIDPJWTConfigRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| idp_id | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| jwt_endpoint | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| issuer | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| keys_endpoint | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| header_name | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
### UpdateOrgIDPJWTConfigResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| details | zitadel.v1.ObjectDetails | - | |
### UpdateOrgIDPOIDCConfigRequest