wso2 / product-is

Welcome to the WSO2 Identity Server source code! For info on working with the WSO2 Identity Server repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
748 stars 729 forks source link

Authorization response URL error comes as ```server_error``` when request object signature validation is failed #20756

Closed Akila94 closed 3 months ago

Akila94 commented 4 months ago

Description :

The following scenario gives a server_error in the response URL when the authorization request is performed,

  1. Get a request_uri for client1 using the /par endpoint.
  2. Use the obtained request_uri from the 1st step in the authorization request.
  3. Use a different client ID in the authorization request parameters (should be a client ID which already exists in the system).
  4. The authorization response will be shown as follows,

Screenshot 2024-07-03 at 11 08 43 AM

After further analysis, it was seen that this is set from the line [1]. It is set when trying to validate the signed request object using the JWKs URI. When the necessary keys are not found in the JWKS URI, this error is thrown.

We need to know whether this server_error is thrown intentionally or should it be corrected as something like signature_validation_failed or a similar message. If that is the case please provide a fix for this.

[1] https://github.com/wso2-support/identity-inbound-auth-oauth/blob/95eed59aa6c7b035afc0cc296d708219281bd875/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/RequestObjectValidatorUtil.java#L153

Product : wso2is-6.1.0 Update level : WSO2 case id : Case number : Public Git Issue : Opened by : @Akila94

Sachin-Mamoru commented 3 months ago

Already fixed [1].

[1] https://github.com/wso2-extensions/identity-inbound-auth-oauth/blob/master/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/RequestObjectValidatorUtil.java#L186