forked from baron/baron-sso
consent 자동 승인 경로 tenantID 전달 누락 수정
This commit is contained in:
@@ -5152,8 +5152,14 @@ func (h *AuthHandler) GetConsentRequest(c *fiber.Ctx) error {
|
|||||||
identity, err := h.KratosAdmin.GetIdentity(c.Context(), consentRequest.Subject)
|
identity, err := h.KratosAdmin.GetIdentity(c.Context(), consentRequest.Subject)
|
||||||
if err == nil && identity != nil {
|
if err == nil && identity != nil {
|
||||||
currentSessionID := h.resolveCurrentSessionID(c)
|
currentSessionID := h.resolveCurrentSessionID(c)
|
||||||
|
var tenantID string
|
||||||
|
if consentRequest.Client.Metadata != nil {
|
||||||
|
if tid, ok := consentRequest.Client.Metadata["tenant_id"].(string); ok {
|
||||||
|
tenantID = tid
|
||||||
|
}
|
||||||
|
}
|
||||||
sessionClaims := withOidcSessionMetadata(
|
sessionClaims := withOidcSessionMetadata(
|
||||||
buildOidcClaimsFromTraits(identity.Traits, consentRequest.RequestedScope),
|
buildOidcClaimsFromTraits(identity.Traits, consentRequest.RequestedScope, tenantID),
|
||||||
currentSessionID,
|
currentSessionID,
|
||||||
)
|
)
|
||||||
acceptResp, err := h.Hydra.AcceptConsentRequest(c.Context(), challenge, consentRequest, sessionClaims)
|
acceptResp, err := h.Hydra.AcceptConsentRequest(c.Context(), challenge, consentRequest, sessionClaims)
|
||||||
|
|||||||
@@ -156,4 +156,4 @@
|
|||||||
"authorizer": { "handler": "allow" },
|
"authorizer": { "handler": "allow" },
|
||||||
"mutators": [{ "handler": "noop" }]
|
"mutators": [{ "handler": "noop" }]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
Reference in New Issue
Block a user