diff --git a/auth/api/iam/api.go b/auth/api/iam/api.go index 21a05464d1..9a0b4e3c1c 100644 --- a/auth/api/iam/api.go +++ b/auth/api/iam/api.go @@ -116,19 +116,27 @@ func (r Wrapper) HandleTokenRequest(ctx context.Context, request HandleTokenRequ // Options: // - OpenID4VCI // - OpenID4VP, vp_token is sent in Token Response - panic("not implemented") + return nil, OAuth2Error{ + Code: UnsupportedGrantType, + Description: "not implemented yet", + } case "vp_token": // Options: // - service-to-service vp_token flow - panic("not implemented") + return nil, OAuth2Error{ + Code: UnsupportedGrantType, + Description: "not implemented yet", + } case "urn:ietf:params:oauth:grant-type:pre-authorized_code": // Options: // - OpenID4VCI - panic("not implemented") + return nil, OAuth2Error{ + Code: UnsupportedGrantType, + Description: "not implemented yet", + } default: return nil, OAuth2Error{ - Code: InvalidRequest, - Description: "unsupported grant_type", + Code: UnsupportedGrantType, } } } diff --git a/auth/api/iam/error.go b/auth/api/iam/error.go index a7e988905b..a70c005052 100644 --- a/auth/api/iam/error.go +++ b/auth/api/iam/error.go @@ -35,6 +35,8 @@ const ( // InvalidRequest is returned when the request is missing a required parameter, includes an invalid parameter value, // includes a parameter more than once, or is otherwise malformed. InvalidRequest ErrorCode = "invalid_request" + // UnsupportedGrantType is returned when the authorization grant type is not supported by the authorization server. + UnsupportedGrantType ErrorCode = "unsupported_grant_type" // UnsupportedResponseType is returned when the authorization server does not support obtaining an authorization code using this method. UnsupportedResponseType ErrorCode = "unsupported_response_type" // ServerError is returned when the Authorization Server encounters an unexpected condition that prevents it from fulfilling the request.