mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:37:32 +00:00
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:
@@ -7,12 +7,13 @@ import (
|
||||
|
||||
type IDPConfig struct {
|
||||
es_models.ObjectRoot
|
||||
IDPConfigID string
|
||||
Type IdpConfigType
|
||||
Name string
|
||||
StylingType IDPStylingType
|
||||
State IDPConfigState
|
||||
OIDCConfig *OIDCIDPConfig
|
||||
IDPConfigID string
|
||||
Type IdpConfigType
|
||||
Name string
|
||||
StylingType IDPStylingType
|
||||
State IDPConfigState
|
||||
OIDCConfig *OIDCIDPConfig
|
||||
JWTIDPConfig *JWTIDPConfig
|
||||
}
|
||||
|
||||
type OIDCIDPConfig struct {
|
||||
@@ -27,11 +28,20 @@ type OIDCIDPConfig struct {
|
||||
UsernameMapping OIDCMappingField
|
||||
}
|
||||
|
||||
type JWTIDPConfig struct {
|
||||
es_models.ObjectRoot
|
||||
IDPConfigID string
|
||||
JWTEndpoint string
|
||||
Issuer string
|
||||
KeysEndpoint string
|
||||
}
|
||||
|
||||
type IdpConfigType int32
|
||||
|
||||
const (
|
||||
IDPConfigTypeOIDC IdpConfigType = iota
|
||||
IDPConfigTypeSAML
|
||||
IDPConfigTypeJWT
|
||||
)
|
||||
|
||||
type IDPConfigState int32
|
||||
|
@@ -29,6 +29,10 @@ type IDPConfigView struct {
|
||||
OIDCUsernameMapping OIDCMappingField
|
||||
OAuthAuthorizationEndpoint string
|
||||
OAuthTokenEndpoint string
|
||||
JWTEndpoint string
|
||||
JWTIssuer string
|
||||
JWTKeysEndpoint string
|
||||
JWTHeaderName string
|
||||
}
|
||||
|
||||
type IDPConfigSearchRequest struct {
|
||||
|
@@ -100,6 +100,8 @@ func idpConfigTypeToDomain(idpType IdpConfigType) domain.IDPConfigType {
|
||||
return domain.IDPConfigTypeOIDC
|
||||
case IDPConfigTypeSAML:
|
||||
return domain.IDPConfigTypeSAML
|
||||
case IDPConfigTypeJWT:
|
||||
return domain.IDPConfigTypeJWT
|
||||
default:
|
||||
return domain.IDPConfigTypeOIDC
|
||||
}
|
||||
|
Reference in New Issue
Block a user