KEYCLOAK-14795: getCredentialTypeMetadata take one arg (#980)

* KEYCLOAK-14795: getCredentialTypeMetadata take one arg

* docs: pr review

* fix: pr review
This commit is contained in:
Ludovic Dussart 2021-11-10 08:38:31 +01:00 committed by GitHub
parent 641941ac3f
commit c47ba98b52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -649,7 +649,7 @@ The config values can be defined within the admin console if you set up config d
[source,java] [source,java]
---- ----
@Override @Override
public CredentialTypeMetadata getCredentialTypeMetadata() { public CredentialTypeMetadata getCredentialTypeMetadata(CredentialTypeMetadataContext metadataContext) {
return CredentialTypeMetadata.builder() return CredentialTypeMetadata.builder()
.type(getType()) .type(getType())
.category(CredentialTypeMetadata.Category.TWO_FACTOR) .category(CredentialTypeMetadata.Category.TWO_FACTOR)
@ -661,8 +661,7 @@ The config values can be defined within the admin console if you set up config d
} }
---- ----
Last method in SecretQuestionCredentialProvider class is getCredentialTypeMetadata(), which is an abstract method of CredentialProvider The last method to implement in the SecretQuestionCredentialProvider class is getCredentialTypeMetadata(CredentialTypeMetadataContext metadataContext), which is an abstract method of the CredentialProvider interface. Each Credential provider has to provide and implement this method. The method returns an instance of CredentialTypeMetadata,
interface. Each Credential provider has to provide and implement this method. The method returns an instance of CredentialTypeMetadata,
which should at least include type and category of authenticator, displayName and removable item. In this example, the builder which should at least include type and category of authenticator, displayName and removable item. In this example, the builder
takes type of authenticator from method getType(), category is Two Factor (the authenticator can be used as second factor of authentication) takes type of authenticator from method getType(), category is Two Factor (the authenticator can be used as second factor of authentication)
and removable, which is set up to false (user can't remove some previously registered credentials). and removable, which is set up to false (user can't remove some previously registered credentials).