Package org.keycloak.protocol
Interface LoginProtocolFactory
- All Superinterfaces:
ProviderFactory<LoginProtocol>
- All Known Implementing Classes:
AbstractLoginProtocolFactory,DockerAuthV2ProtocolFactory,OID4VCLoginProtocolFactory,OIDCLoginProtocolFactory,SamlProtocolFactory
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddClientScopeDefaults(ClientScopeRepresentation clientScope) Add default values toClientScopeRepresentations that refer to the specific login-protocolvoidcreateDefaultClientScopes(RealmModel newRealm, boolean addScopesToExistingClients) Called when new realm is createdcreateProtocolEndpoint(KeycloakSession session, EventBuilder event) List of built in protocol mappers that can be used to apply to clients.default booleanisValidClientScope(KeycloakSession session, ClientModel client, ClientScopeModel clientScope) Test if the clientScope is valid for particular client.voidsetupClientDefaults(ClientRepresentation rep, ClientModel newClient) Setup default values for new clients.default voidvalidateClientScope(KeycloakSession session, ClientScopeRepresentation clientScope) Invoked during client-scope creation or update to add additional validation hooks specific to target protocol.default voidvalidateClientScopeAssignment(KeycloakSession session, ClientScopeModel clientScope, boolean defaultScope, RealmModel realm) Validates whether a client scope can be assigned as Default or Optional to a client or realm.Methods inherited from interface org.keycloak.provider.ProviderFactory
close, create, dependsOn, getConfigMetadata, getId, init, order, postInit
-
Method Details
-
getBuiltinMappers
Map<String,ProtocolMapperModel> getBuiltinMappers()List of built in protocol mappers that can be used to apply to clients.- Returns:
-
createProtocolEndpoint
-
createDefaultClientScopes
Called when new realm is created- Parameters:
newRealm-addScopesToExistingClients- If true, then existing realm clients will be updated (created realm default scopes will be added to them)
-
setupClientDefaults
Setup default values for new clients. This expects that the representation has already set up the client- Parameters:
rep-newClient-
-
addClientScopeDefaults
Add default values toClientScopeRepresentations that refer to the specific login-protocol -
validateClientScope
default void validateClientScope(KeycloakSession session, ClientScopeRepresentation clientScope) throws jakarta.ws.rs.WebApplicationException Invoked during client-scope creation or update to add additional validation hooks specific to target protocol. May throw errorResponseException in case- Parameters:
session- Keycloak sessionclientScope- client scope to create or update- Throws:
jakarta.ws.rs.WebApplicationException- or some of it's subclass if validation fails
-
isValidClientScope
default boolean isValidClientScope(KeycloakSession session, ClientModel client, ClientScopeModel clientScope) Test if the clientScope is valid for particular client. Usually called during protocol requests -
validateClientScopeAssignment
default void validateClientScopeAssignment(KeycloakSession session, ClientScopeModel clientScope, boolean defaultScope, RealmModel realm) Validates whether a client scope can be assigned as Default or Optional to a client or realm. This method is called before assigning a client scope to ensure protocol-specific restrictions are enforced.- Parameters:
session- the Keycloak sessionclientScope- the client scope to be assigneddefaultScope- true if assigning as Default scope, false if Optionalrealm- the realm where the assignment is happening- Throws:
jakarta.ws.rs.BadRequestException- if the assignment is not allowed
-