mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 01:37:31 +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:
@@ -31,6 +31,25 @@ func addOIDCIDPRequestToDomainOIDCIDPConfig(req *admin_pb.AddOIDCIDPRequest) *do
|
||||
}
|
||||
}
|
||||
|
||||
func addJWTIDPRequestToDomain(req *admin_pb.AddJWTIDPRequest) *domain.IDPConfig {
|
||||
return &domain.IDPConfig{
|
||||
Name: req.Name,
|
||||
JWTConfig: addJWTIDPRequestToDomainJWTIDPConfig(req),
|
||||
StylingType: idp_grpc.IDPStylingTypeToDomain(req.StylingType),
|
||||
Type: domain.IDPConfigTypeJWT,
|
||||
AutoRegister: req.AutoRegister,
|
||||
}
|
||||
}
|
||||
|
||||
func addJWTIDPRequestToDomainJWTIDPConfig(req *admin_pb.AddJWTIDPRequest) *domain.JWTIDPConfig {
|
||||
return &domain.JWTIDPConfig{
|
||||
JWTEndpoint: req.JwtEndpoint,
|
||||
Issuer: req.Issuer,
|
||||
KeysEndpoint: req.KeysEndpoint,
|
||||
HeaderName: req.HeaderName,
|
||||
}
|
||||
}
|
||||
|
||||
func updateIDPToDomain(req *admin_pb.UpdateIDPRequest) *domain.IDPConfig {
|
||||
return &domain.IDPConfig{
|
||||
IDPConfigID: req.IdpId,
|
||||
@@ -52,6 +71,16 @@ func updateOIDCConfigToDomain(req *admin_pb.UpdateIDPOIDCConfigRequest) *domain.
|
||||
}
|
||||
}
|
||||
|
||||
func updateJWTConfigToDomain(req *admin_pb.UpdateIDPJWTConfigRequest) *domain.JWTIDPConfig {
|
||||
return &domain.JWTIDPConfig{
|
||||
IDPConfigID: req.IdpId,
|
||||
JWTEndpoint: req.JwtEndpoint,
|
||||
Issuer: req.Issuer,
|
||||
KeysEndpoint: req.KeysEndpoint,
|
||||
HeaderName: req.HeaderName,
|
||||
}
|
||||
}
|
||||
|
||||
func listIDPsToModel(req *admin_pb.ListIDPsRequest) *iam_model.IDPConfigSearchRequest {
|
||||
offset, limit, asc := object.ListQueryToModel(req.Query)
|
||||
return &iam_model.IDPConfigSearchRequest{
|
||||
|
Reference in New Issue
Block a user