Search in sources :

Example 11 with EventBuilder

use of org.keycloak.events.EventBuilder in project keycloak by keycloak.

the class RealmsResource method getClientsService.

@Path("{realm}/clients-registrations")
public ClientRegistrationService getClientsService(@PathParam("realm") final String name) {
    RealmModel realm = init(name);
    EventBuilder event = new EventBuilder(realm, session, clientConnection);
    ClientRegistrationService service = new ClientRegistrationService(event);
    ResteasyProviderFactory.getInstance().injectProperties(service);
    return service;
}
Also used : RealmModel(org.keycloak.models.RealmModel) EventBuilder(org.keycloak.events.EventBuilder) ClientRegistrationService(org.keycloak.services.clientregistration.ClientRegistrationService) Path(javax.ws.rs.Path)

Example 12 with EventBuilder

use of org.keycloak.events.EventBuilder in project keycloak by keycloak.

the class RealmsResource method getClientsManagementService.

@Path("{realm}/clients-managements")
public ClientsManagementService getClientsManagementService(@PathParam("realm") final String name) {
    RealmModel realm = init(name);
    EventBuilder event = new EventBuilder(realm, session, clientConnection);
    ClientsManagementService service = new ClientsManagementService(realm, event);
    ResteasyProviderFactory.getInstance().injectProperties(service);
    return service;
}
Also used : RealmModel(org.keycloak.models.RealmModel) EventBuilder(org.keycloak.events.EventBuilder) Path(javax.ws.rs.Path)

Example 13 with EventBuilder

use of org.keycloak.events.EventBuilder in project keycloak by keycloak.

the class RealmsResource method getProtocol.

@Path("{realm}/protocol/{protocol}")
public Object getProtocol(@PathParam("realm") final String name, @PathParam("protocol") final String protocol) {
    RealmModel realm = init(name);
    LoginProtocolFactory factory = (LoginProtocolFactory) session.getKeycloakSessionFactory().getProviderFactory(LoginProtocol.class, protocol);
    if (factory == null) {
        logger.debugf("protocol %s not found", protocol);
        throw new NotFoundException("Protocol not found");
    }
    EventBuilder event = new EventBuilder(realm, session, clientConnection);
    Object endpoint = factory.createProtocolEndpoint(realm, event);
    ResteasyProviderFactory.getInstance().injectProperties(endpoint);
    return endpoint;
}
Also used : RealmModel(org.keycloak.models.RealmModel) LoginProtocolFactory(org.keycloak.protocol.LoginProtocolFactory) EventBuilder(org.keycloak.events.EventBuilder) NotFoundException(javax.ws.rs.NotFoundException) LoginProtocol(org.keycloak.protocol.LoginProtocol) Path(javax.ws.rs.Path)

Example 14 with EventBuilder

use of org.keycloak.events.EventBuilder in project keycloak by keycloak.

the class RealmsResource method getLoginActionsService.

@Path("{realm}/login-actions")
public LoginActionsService getLoginActionsService(@PathParam("realm") final String name) {
    RealmModel realm = init(name);
    EventBuilder event = new EventBuilder(realm, session, clientConnection);
    LoginActionsService service = new LoginActionsService(realm, event);
    ResteasyProviderFactory.getInstance().injectProperties(service);
    return service;
}
Also used : RealmModel(org.keycloak.models.RealmModel) EventBuilder(org.keycloak.events.EventBuilder) Path(javax.ws.rs.Path)

Example 15 with EventBuilder

use of org.keycloak.events.EventBuilder in project keycloak by keycloak.

the class DeviceEndpointFactory method create.

@Override
public RealmResourceProvider create(KeycloakSession session) {
    KeycloakContext context = session.getContext();
    RealmModel realm = context.getRealm();
    EventBuilder event = new EventBuilder(realm, session, context.getConnection());
    DeviceEndpoint provider = new DeviceEndpoint(realm, event);
    ResteasyProviderFactory.getInstance().injectProperties(provider);
    return provider;
}
Also used : RealmModel(org.keycloak.models.RealmModel) EventBuilder(org.keycloak.events.EventBuilder) KeycloakContext(org.keycloak.models.KeycloakContext)

Aggregations

EventBuilder (org.keycloak.events.EventBuilder)27 RealmModel (org.keycloak.models.RealmModel)14 UserModel (org.keycloak.models.UserModel)9 Response (javax.ws.rs.core.Response)8 Path (javax.ws.rs.Path)7 AuthenticationSessionModel (org.keycloak.sessions.AuthenticationSessionModel)6 List (java.util.List)4 ClientModel (org.keycloak.models.ClientModel)4 KeycloakSession (org.keycloak.models.KeycloakSession)4 UserSessionModel (org.keycloak.models.UserSessionModel)4 HashMap (java.util.HashMap)3 EmailException (org.keycloak.email.EmailException)3 FormMessage (org.keycloak.models.utils.FormMessage)3 ValidationException (org.keycloak.userprofile.ValidationException)3 URI (java.net.URI)2 NotFoundException (javax.ws.rs.NotFoundException)2 POST (javax.ws.rs.POST)2 UriBuilder (javax.ws.rs.core.UriBuilder)2 AuthenticatedClientSessionModel (org.keycloak.models.AuthenticatedClientSessionModel)2 ClientSessionContext (org.keycloak.models.ClientSessionContext)2