1
0
mirror of synced 2026-08-05 17:57:15 +00:00

Add authenticationFailureHandler method in OAuth2LoginSpec

Allow to customize the failure handler.

Fixes gh-7051
This commit is contained in:
Eddú Meléndez
2019-07-04 01:28:17 -05:00
committed by Rob Winch
parent b3da1e466b
commit 2c836a171a
3 changed files with 89 additions and 11 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ package org.springframework.security.oauth2.core.endpoint;
/**
* @author Rob Winch
* @author Eddú Meléndez
* @since 5.1
*/
public class TestOAuth2AuthorizationExchanges {
@@ -27,4 +28,10 @@ public class TestOAuth2AuthorizationExchanges {
OAuth2AuthorizationResponse response = TestOAuth2AuthorizationResponses.success().build();
return new OAuth2AuthorizationExchange(request, response);
}
public static OAuth2AuthorizationExchange failure() {
OAuth2AuthorizationRequest request = TestOAuth2AuthorizationRequests.request().build();
OAuth2AuthorizationResponse response = TestOAuth2AuthorizationResponses.error().build();
return new OAuth2AuthorizationExchange(request, response);
}
}