Package org.keycloak.protocol.oidc.scope
Class UsernameScopeType
java.lang.Object
org.keycloak.protocol.oidc.scope.UsernameScopeType
- All Implemented Interfaces:
org.keycloak.protocol.oidc.scope.ParameterizedScopeTypeProvider,org.keycloak.provider.Provider,org.keycloak.provider.ProviderFactory<org.keycloak.protocol.oidc.scope.ParameterizedScopeTypeProvider>
- Direct Known Subclasses:
DelegationScopeType
public class UsernameScopeType
extends Object
implements org.keycloak.protocol.oidc.scope.ParameterizedScopeTypeProvider
Parameterized scope type that validates the parameter is an existing username in the realm.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanAccessTargetUser(org.keycloak.models.ClientScopeModel scope, org.keycloak.models.UserModel currentUser, org.keycloak.models.UserModel targetUser) Checks whether the authenticated user is allowed to access the target user's data for this scope.org.keycloak.protocol.oidc.scope.ParameterizedScopeTypeProvidercreate(org.keycloak.models.KeycloakSession session) protected org.keycloak.models.UserModelresolveUser(org.keycloak.models.ClientScopeModel scope, String parameter) voidvalidateParameter(org.keycloak.models.ClientScopeModel scope, String parameter) voidvalidateParameterWithUser(org.keycloak.models.UserModel currentUser, org.keycloak.models.ClientScopeModel scope, String parameter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.protocol.oidc.scope.ParameterizedScopeTypeProvider
close, getId, init, isRepeatable, postInitMethods inherited from interface org.keycloak.provider.ProviderFactory
dependsOn, getConfigMetadata, order
-
Field Details
-
TYPE
- See Also:
-
session
protected final org.keycloak.models.KeycloakSession session
-
-
Constructor Details
-
UsernameScopeType
public UsernameScopeType() -
UsernameScopeType
public UsernameScopeType(org.keycloak.models.KeycloakSession session)
-
-
Method Details
-
getTypeName
- Specified by:
getTypeNamein interfaceorg.keycloak.protocol.oidc.scope.ParameterizedScopeTypeProvider
-
create
public org.keycloak.protocol.oidc.scope.ParameterizedScopeTypeProvider create(org.keycloak.models.KeycloakSession session) - Specified by:
createin interfaceorg.keycloak.protocol.oidc.scope.ParameterizedScopeTypeProvider- Specified by:
createin interfaceorg.keycloak.provider.ProviderFactory<org.keycloak.protocol.oidc.scope.ParameterizedScopeTypeProvider>
-
canAccessTargetUser
public boolean canAccessTargetUser(org.keycloak.models.ClientScopeModel scope, org.keycloak.models.UserModel currentUser, org.keycloak.models.UserModel targetUser) Checks whether the authenticated user is allowed to access the target user's data for this scope. -
validateParameter
public void validateParameter(@Nonnull org.keycloak.models.ClientScopeModel scope, @Nonnull String parameter) throws org.keycloak.protocol.oidc.scope.InvalidScopeParameterException - Specified by:
validateParameterin interfaceorg.keycloak.protocol.oidc.scope.ParameterizedScopeTypeProvider- Throws:
org.keycloak.protocol.oidc.scope.InvalidScopeParameterException
-
validateParameterWithUser
public void validateParameterWithUser(@Nonnull org.keycloak.models.UserModel currentUser, @Nonnull org.keycloak.models.ClientScopeModel scope, @Nonnull String parameter) throws org.keycloak.protocol.oidc.scope.InvalidScopeParameterException - Specified by:
validateParameterWithUserin interfaceorg.keycloak.protocol.oidc.scope.ParameterizedScopeTypeProvider- Throws:
org.keycloak.protocol.oidc.scope.InvalidScopeParameterException
-
resolveUser
protected org.keycloak.models.UserModel resolveUser(org.keycloak.models.ClientScopeModel scope, String parameter) throws org.keycloak.protocol.oidc.scope.InvalidScopeParameterException - Throws:
org.keycloak.protocol.oidc.scope.InvalidScopeParameterException
-