Skip to content

Commit

Permalink
clarifying audit comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hoo29 committed Jul 10, 2021
1 parent 03fb0d3 commit 32216f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/space/huws/apps/ClientRoleAuthenticator.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@ public void authenticate(AuthenticationFlowContext context) {
* defined case for ACCESS_DENIED and will return the default INVALID_USER_CREDENTIALS error to the browser, which
* might be confusing for users as their credentials are valid.
*
* The audit event generated is also INVALID_USER_CREDENTIALS which is again not correct.
*
* We create our own error page to return a more accurate error.
*/

context.getEvent().error(Errors.ACCESS_DENIED);

final LoginFormsProvider forms = context.form();
forms.setError(Messages.ACCESS_DENIED);
final Response errorResponse = forms.createErrorPage(Response.Status.FORBIDDEN);
Expand Down

0 comments on commit 32216f8

Please sign in to comment.