Skip to content
This repository was archived by the owner on Aug 26, 2026. It is now read-only.
This repository was archived by the owner on Aug 26, 2026. It is now read-only.

Consider logging invalid redirect_uri and scope #1245

Closed

Description

@sjohnr

OAuth2AuthorizationCodeRequestAuthenticationValidator.validateRedirectUri throws OAuth2AuthorizationCodeRequestAuthenticationToken when an invalid redirect_uri is used during the authorization request.

https://github.com/spring-projects/spring-authorization-server/blob/27a893fbeea7ec1f8ebb85be9242f17b24223e72/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2AuthorizationCodeRequestAuthenticationValidator.java#L126-L129

Additionally, OAuth2AuthorizationCodeRequestAuthenticationValidator.validateScope throws the same when an invalid scope is used.

https://github.com/spring-projects/spring-authorization-server/blob/27a893fbeea7ec1f8ebb85be9242f17b24223e72/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2AuthorizationCodeRequestAuthenticationValidator.java#L78-L81

We should consider adding a log entry at DEBUG level in OAuth2AuthorizationCodeRequestAuthenticationValidator for each of these cases. This would allow the logging level to be tuned specifically for this logging. If a user customizes the authentication validators e.g. to add custom redirect uri validation, they would be responsible for their own logging.

Activity

  1. changed the title [-]Consider adding logging for invalid `redirect_uri`[/-] [+]Consider adding logging for invalid `redirect_uri` and `scope`[/+] on May 30, 2023
  2. changed the title [-]Consider adding logging for invalid `redirect_uri` and `scope`[/-] [+]Consider logging invalid `redirect_uri` and `scope`[/+] on May 30, 2023
  3. added a commit that references this issue on Jun 13, 2023
  4. self-assigned this
    on Jun 13, 2023
  5. added this to the milestone on Jun 13, 2023
  6. modified the milestones: , 1.2.0-M2 on Aug 1, 2023
  7. added a commit that references this issue on Oct 2, 2023
    219ef93
  8. added a commit that references this issue on Feb 19, 2024
    6b6b211
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions