diff --git a/broker/core/src/main/java/org/keycloak/broker/provider/IdentityProvider.java b/broker/core/src/main/java/org/keycloak/broker/provider/IdentityProvider.java index 47037fae22..1d775eec5c 100755 --- a/broker/core/src/main/java/org/keycloak/broker/provider/IdentityProvider.java +++ b/broker/core/src/main/java/org/keycloak/broker/provider/IdentityProvider.java @@ -36,7 +36,7 @@ import javax.ws.rs.core.UriInfo; */ public interface IdentityProvider extends Provider { - public interface AuthenticationCallback { + interface AuthenticationCallback { /** * This method should be called by provider after the JAXRS callback endpoint has finished authentication * with the remote IDP @@ -44,7 +44,11 @@ public interface IdentityProvider extends Provi * @param context * @return */ - public Response authenticated(BrokeredIdentityContext context); + Response authenticated(BrokeredIdentityContext context); + + Response cancelled(String code); + + Response error(String code, String message); } diff --git a/broker/oidc/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java b/broker/oidc/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java index b80949af2f..376210db27 100755 --- a/broker/oidc/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java +++ b/broker/oidc/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java @@ -58,6 +58,7 @@ public abstract class AbstractOAuth2IdentityProvider search(@QueryParam("username") String username, + List search(@QueryParam("username") String username, @QueryParam("firstName") String firstName, @QueryParam("lastName") String lastName, @QueryParam("email") String email, @@ -26,7 +26,7 @@ public interface UsersResource { @GET @Produces(MediaType.APPLICATION_JSON) - public List search(@QueryParam("search") String search, + List search(@QueryParam("search") String search, @QueryParam("first") Integer firstResult, @QueryParam("max") Integer maxResults); @@ -34,7 +34,7 @@ public interface UsersResource { @Consumes(MediaType.APPLICATION_JSON) Response create(UserRepresentation userRepresentation); - @Path("{username}") - public UserResource get(@PathParam("username") String username); + @Path("{id}") + UserResource get(@PathParam("id") String id); } diff --git a/services/src/main/java/org/keycloak/services/resources/IdentityBrokerService.java b/services/src/main/java/org/keycloak/services/resources/IdentityBrokerService.java index e1d6bfa5b8..eae77cd780 100755 --- a/services/src/main/java/org/keycloak/services/resources/IdentityBrokerService.java +++ b/services/src/main/java/org/keycloak/services/resources/IdentityBrokerService.java @@ -315,6 +315,16 @@ public class IdentityBrokerService implements IdentityProvider.AuthenticationCal this.uriInfo, event); } + @Override + public Response cancelled(String code) { + return session.getProvider(LoginFormsProvider.class).setClientSessionCode(code).createLogin(); + } + + @Override + public Response error(String code, String message) { + return session.getProvider(LoginFormsProvider.class).setClientSessionCode(code).setError(message).createLogin(); + } + private Response performAccountLinking(ClientSessionModel clientSession, BrokeredIdentityContext context, FederatedIdentityModel federatedIdentityModel, UserModel federatedUser) { this.event.event(EventType.IDENTITY_PROVIDER_ACCCOUNT_LINKING);