keycloak-service
公開メンバ関数 | 静的公開変数類 | 限定公開メンバ関数 | 全メンバ一覧
org.keycloak.authentication.authenticators.directgrant.ValidatePassword クラス
org.keycloak.authentication.authenticators.directgrant.ValidatePassword の継承関係図
Inheritance graph
org.keycloak.authentication.authenticators.directgrant.ValidatePassword 連携図
Collaboration graph

公開メンバ関数

void authenticate (AuthenticationFlowContext context)
 
boolean requiresUser ()
 
boolean configuredFor (KeycloakSession session, RealmModel realm, UserModel user)
 
void setRequiredActions (KeycloakSession session, RealmModel realm, UserModel user)
 
boolean isUserSetupAllowed ()
 
String getDisplayType ()
 
String getReferenceCategory ()
 
boolean isConfigurable ()
 
AuthenticationExecutionModel.Requirement [] getRequirementChoices ()
 
String getHelpText ()
 
List< ProviderConfigProperty > getConfigProperties ()
 
String getId ()
 
Response errorResponse (int status, String error, String errorDescription)
 
void action (AuthenticationFlowContext context)
 
void close ()
 
Authenticator create (KeycloakSession session)
 
void init (Config.Scope config)
 
void postInit (KeycloakSessionFactory factory)
 

静的公開変数類

static final String PROVIDER_ID = "direct-grant-validate-password"
 
static final AuthenticationExecutionModel.Requirement [] REQUIREMENT_CHOICES
 

限定公開メンバ関数

String retrievePassword (AuthenticationFlowContext context)
 

詳解

著者
Bill Burke
バージョン
Revision
1

関数詳解

◆ action()

void org.keycloak.authentication.authenticators.directgrant.AbstractDirectGrantAuthenticator.action ( AuthenticationFlowContext  context)
inlineinherited
42  {
43 
44  }

◆ authenticate()

void org.keycloak.authentication.authenticators.directgrant.ValidatePassword.authenticate ( AuthenticationFlowContext  context)
inline
45  {
46  String password = retrievePassword(context);
47  boolean valid = context.getSession().userCredentialManager().isValid(context.getRealm(), context.getUser(), UserCredentialModel.password(password));
48  if (!valid) {
49  context.getEvent().user(context.getUser());
50  context.getEvent().error(Errors.INVALID_USER_CREDENTIALS);
51  Response challengeResponse = errorResponse(Response.Status.UNAUTHORIZED.getStatusCode(), "invalid_grant", "Invalid user credentials");
52  context.failure(AuthenticationFlowError.INVALID_USER, challengeResponse);
53  return;
54  }
55 
56  context.success();
57  }
Response errorResponse(int status, String error, String errorDescription)
Definition: AbstractDirectGrantAuthenticator.java:36
String retrievePassword(AuthenticationFlowContext context)
Definition: ValidatePassword.java:120

◆ close()

void org.keycloak.authentication.authenticators.directgrant.AbstractDirectGrantAuthenticator.close ( )
inlineinherited
47  {
48 
49  }

◆ configuredFor()

boolean org.keycloak.authentication.authenticators.directgrant.ValidatePassword.configuredFor ( KeycloakSession  session,
RealmModel  realm,
UserModel  user 
)
inline
65  {
66  return true;
67  }

◆ create()

Authenticator org.keycloak.authentication.authenticators.directgrant.AbstractDirectGrantAuthenticator.create ( KeycloakSession  session)
inlineinherited
52  {
53  return this;
54  }

◆ errorResponse()

Response org.keycloak.authentication.authenticators.directgrant.AbstractDirectGrantAuthenticator.errorResponse ( int  status,
String  error,
String  errorDescription 
)
inlineinherited
36  {
37  OAuth2ErrorRepresentation errorRep = new OAuth2ErrorRepresentation(error, errorDescription);
38  return Response.status(status).entity(errorRep).type(MediaType.APPLICATION_JSON_TYPE).build();
39  }

◆ getConfigProperties()

List<ProviderConfigProperty> org.keycloak.authentication.authenticators.directgrant.ValidatePassword.getConfigProperties ( )
inline
111  {
112  return new LinkedList<>();
113  }

◆ getDisplayType()

String org.keycloak.authentication.authenticators.directgrant.ValidatePassword.getDisplayType ( )
inline
81  {
82  return "Password";
83  }

◆ getHelpText()

String org.keycloak.authentication.authenticators.directgrant.ValidatePassword.getHelpText ( )
inline
106  {
107  return "Validates the password supplied as a 'password' form parameter in direct grant request";
108  }

◆ getId()

String org.keycloak.authentication.authenticators.directgrant.ValidatePassword.getId ( )
inline
116  {
117  return PROVIDER_ID;
118  }
static final String PROVIDER_ID
Definition: ValidatePassword.java:42

◆ getReferenceCategory()

String org.keycloak.authentication.authenticators.directgrant.ValidatePassword.getReferenceCategory ( )
inline
86  {
87  return null;
88  }

◆ getRequirementChoices()

AuthenticationExecutionModel.Requirement [] org.keycloak.authentication.authenticators.directgrant.ValidatePassword.getRequirementChoices ( )
inline
101  {
102  return REQUIREMENT_CHOICES;
103  }
static final AuthenticationExecutionModel.Requirement [] REQUIREMENT_CHOICES
Definition: ValidatePassword.java:95

◆ init()

void org.keycloak.authentication.authenticators.directgrant.AbstractDirectGrantAuthenticator.init ( Config.Scope  config)
inlineinherited
57  {
58 
59  }

◆ isConfigurable()

boolean org.keycloak.authentication.authenticators.directgrant.ValidatePassword.isConfigurable ( )
inline
91  {
92  return false;
93  }

◆ isUserSetupAllowed()

boolean org.keycloak.authentication.authenticators.directgrant.ValidatePassword.isUserSetupAllowed ( )
inline
75  {
76  return false;
77  }

◆ postInit()

void org.keycloak.authentication.authenticators.directgrant.AbstractDirectGrantAuthenticator.postInit ( KeycloakSessionFactory  factory)
inlineinherited
62  {
63 
64  }

◆ requiresUser()

boolean org.keycloak.authentication.authenticators.directgrant.ValidatePassword.requiresUser ( )
inline
60  {
61  return true;
62  }

◆ retrievePassword()

String org.keycloak.authentication.authenticators.directgrant.ValidatePassword.retrievePassword ( AuthenticationFlowContext  context)
inlineprotected
120  {
121  MultivaluedMap<String, String> inputData = context.getHttpRequest().getDecodedFormParameters();
122  return inputData.getFirst(CredentialRepresentation.PASSWORD);
123  }

◆ setRequiredActions()

void org.keycloak.authentication.authenticators.directgrant.ValidatePassword.setRequiredActions ( KeycloakSession  session,
RealmModel  realm,
UserModel  user 
)
inline
70  {
71 
72  }

メンバ詳解

◆ PROVIDER_ID

final String org.keycloak.authentication.authenticators.directgrant.ValidatePassword.PROVIDER_ID = "direct-grant-validate-password"
static

◆ REQUIREMENT_CHOICES

final AuthenticationExecutionModel.Requirement [] org.keycloak.authentication.authenticators.directgrant.ValidatePassword.REQUIREMENT_CHOICES
static
初期値:
= {
AuthenticationExecutionModel.Requirement.REQUIRED,
AuthenticationExecutionModel.Requirement.DISABLED
}

このクラス詳解は次のファイルから抽出されました: