[KEYCLOAK-883] - Reverting change that redirects to error page when federating identities..
This commit is contained in:
parent
69da51cc56
commit
17653e7e74
1 changed files with 15 additions and 1 deletions
|
@ -323,7 +323,7 @@ public class IdentityBrokerService {
|
|||
federatedUser.addRequiredAction(UPDATE_PROFILE);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return redirectToErrorPage(e.getMessage(), e);
|
||||
return redirectToLoginPage(e, clientCode);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -447,6 +447,20 @@ public class IdentityBrokerService {
|
|||
return Flows.forwardToSecurityFailurePage(this.session, this.realmModel, this.uriInfo, message);
|
||||
}
|
||||
|
||||
private Response redirectToLoginPage(Throwable t, ClientSessionCode clientCode) {
|
||||
String message = t.getMessage();
|
||||
|
||||
if (message == null) {
|
||||
message = "Unexpected error when authenticating with identity provider";
|
||||
}
|
||||
|
||||
fireErrorEvent(message);
|
||||
return Flows.forms(this.session, this.realmModel, clientCode.getClientSession().getClient(), this.uriInfo)
|
||||
.setClientSessionCode(clientCode.getCode())
|
||||
.setError(message)
|
||||
.createLogin();
|
||||
}
|
||||
|
||||
private Response badRequest(String message) {
|
||||
fireErrorEvent(message);
|
||||
return Flows.errors().error(message, Status.BAD_REQUEST);
|
||||
|
|
Loading…
Reference in a new issue