From 6f459916001afd8df431990a86944925511db460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Fri, 22 Sep 2023 07:57:42 +0300 Subject: [PATCH] remove unuse ValidateAuthRequestV2 function --- pkg/op/auth_request.go | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/pkg/op/auth_request.go b/pkg/op/auth_request.go index 85c8ef4..20b1bf4 100644 --- a/pkg/op/auth_request.go +++ b/pkg/op/auth_request.go @@ -228,44 +228,6 @@ func ValidateAuthRequest(ctx context.Context, authReq *oidc.AuthRequest, storage return ValidateAuthReqIDTokenHint(ctx, authReq.IDTokenHint, verifier) } -// ValidateAuthRequest validates the authorize parameters and returns the userID of the id_token_hint if passed -func ValidateAuthRequestV2(ctx context.Context, authReq *oidc.AuthRequest, provider Authorizer) (sub string, err error) { - if authReq.RequestParam != "" && provider.RequestObjectSupported() { - err := ParseRequestObject(ctx, authReq, provider.Storage(), IssuerFromContext(ctx)) - if err != nil { - return "", err - } - } - if authReq.ClientID == "" { - return "", ErrAuthReqMissingClientID - } - if authReq.RedirectURI == "" { - return "", ErrAuthReqMissingRedirectURI - } - if authReq.RequestParam != "" { - return "", oidc.ErrRequestNotSupported() - } - authReq.MaxAge, err = ValidateAuthReqPrompt(authReq.Prompt, authReq.MaxAge) - if err != nil { - return "", err - } - client, err := provider.Storage().GetClientByClientID(ctx, authReq.ClientID) - if err != nil { - return "", oidc.DefaultToServerError(err, "unable to retrieve client by id") - } - authReq.Scopes, err = ValidateAuthReqScopes(client, authReq.Scopes) - if err != nil { - return "", err - } - if err := ValidateAuthReqRedirectURI(client, authReq.RedirectURI, authReq.ResponseType); err != nil { - return "", err - } - if err := ValidateAuthReqResponseType(client, authReq.ResponseType); err != nil { - return "", err - } - return ValidateAuthReqIDTokenHint(ctx, authReq.IDTokenHint, provider.IDTokenHintVerifier(ctx)) -} - // ValidateAuthReqPrompt validates the passed prompt values and sets max_age to 0 if prompt login is present func ValidateAuthReqPrompt(prompts []string, maxAge *uint) (_ *uint, err error) { for _, prompt := range prompts {