Describe the bug
If client not pass state when authorization, it throws 500 error when user click cancel button in consent page.
The error was throwed in OAuth2AuthorizationCodeRequestAuthenticationToken
if (this.consent) {
Assert.hasText(this.state, "state cannot be empty");
}


However click allow it can be redirected to client uri successful.

According to OAuth RFC, state is recommended in authorization endpoint.
So why we need to assert state when require consent?
To Reproduce
- Client open authorization url without state
- User login and click cancel button.
- Display 500 error page

Expected behavior
state should be recommended for client, not only when user allow authorization but also reject.