Package org.keycloak.organization
Interface InvitationManager
public interface InvitationManager
-
Method Summary
Modifier and TypeMethodDescriptioncreate(OrganizationModel organization, String email, String firstName, String lastName) Creates a new invitation for a user to join an organization.getAllStream(OrganizationModel organization, Map<OrganizationInvitationModel.Filter, String> attributes, Integer first, Integer max) Get all invitations for the given organization.default OrganizationInvitationModelgetByEmail(OrganizationModel organization, String email) Retrieves an invitation by email and organization.Retrieves an invitation by its ID for a specific organization.booleanDeletes an invitation permanently.
-
Method Details
-
create
OrganizationInvitationModel create(OrganizationModel organization, String email, String firstName, String lastName) Creates a new invitation for a user to join an organization. The invitation will use the realm's default action token lifespan.- Parameters:
organization- the organizationemail- the email address of the user to invitefirstName- the first name of the user (optional)lastName- the last name of the user (optional)- Returns:
- the created invitation
-
getById
Retrieves an invitation by its ID for a specific organization.- Parameters:
id- the invitation ID- Returns:
- the invitation, or null if not found
-
getByEmail
Retrieves an invitation by email and organization.- Parameters:
email- the email addressorganization- the organization- Returns:
- the invitation, or null if not found
-
getAllStream
Stream<OrganizationInvitationModel> getAllStream(OrganizationModel organization, Map<OrganizationInvitationModel.Filter, String> attributes, Integer first, Integer max) Get all invitations for the given organization.- Returns:
- a stream of all invitations for the organization
-
remove
Deletes an invitation permanently.- Parameters:
id- the invitation ID- Returns:
- true if successful, false if invitation not found
-