From 25f965aa2e88a47d2df7e09a196dbf91f99359d7 Mon Sep 17 00:00:00 2001 From: mposolda Date: Fri, 11 Mar 2016 10:05:07 +0100 Subject: [PATCH] KEYCLOAK-2628 protected method to IdpCreateUserIfUniqueAuthenticator after user is registered --- .../broker/IdpCreateUserIfUniqueAuthenticator.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpCreateUserIfUniqueAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpCreateUserIfUniqueAuthenticator.java index e16d759d87..6971ab5dd9 100644 --- a/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpCreateUserIfUniqueAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/broker/IdpCreateUserIfUniqueAuthenticator.java @@ -88,7 +88,7 @@ public class IdpCreateUserIfUniqueAuthenticator extends AbstractIdpAuthenticator federatedUser.addRequiredAction(UserModel.RequiredAction.UPDATE_PASSWORD); } - // TODO: Event + userRegisteredSuccess(context, federatedUser, serializedCtx, brokerContext); context.setUser(federatedUser); context.getClientSession().setNote(BROKER_REGISTERED_NEW_USER, "true"); @@ -140,6 +140,12 @@ public class IdpCreateUserIfUniqueAuthenticator extends AbstractIdpAuthenticator } + // Empty method by default. This exists, so subclass can override and add callback after new user is registered through social + protected void userRegisteredSuccess(AuthenticationFlowContext context, UserModel registeredUser, SerializedBrokeredIdentityContext serializedCtx, BrokeredIdentityContext brokerContext) { + + } + + @Override public boolean requiresUser() { return false;