Keycloak Example - The method getValue() is undefined for the type UserCredentialModel

Defoncesko :

I am trying to handle keycloak's Custom User Storage SPI with the example provided. https://github.com/keycloak/keycloak-quickstarts/tree/latest/user-storage-simple

When launching mvn clean install wildfly:deploy while Keycloak is launched, I get 3 errors from this file PropertyFileUserStorageProvider.java:

variable cred of type org.keycloak.models.UserCredentialModel cannot find symbol (method getValue())

I don't get why I am facing those errors. They also use this getValue method in the documentation. https://www.keycloak.org/docs/latest/server_development/index.html#_user-storage-spi

Java & Maven versions

  • Java Version 1.8.0_20
  • Apache Maven 3.6.2

Thanks for your help

Fabrice G. :

UserCredentialModel class has changed a lot in the latest Keycloak release 8.0.0

It looks like the "quick start examples" need some fixes to work with this release

Something like :

    @Override
    public boolean isValid(RealmModel realm, UserModel user, CredentialInput input) {
        // No need to check input is of type UserCredentialModel since there no need to cast it anymore
        if (!supportsCredentialType(input.getType())) return false;

        String password = properties.getProperty(user.getUsername());
        if (password == null) return false;
        // Input Password can now be obtained using the getChallengeResponse() method of the CredentialInput  type
        return password.equals(input.getChallengeResponse());
    }

Hope this will help.

Regards,

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

The method and() is undefined for the type HttpSecurity

分類Dev

The method getinstance(Context) is undefined for the type AccessibilityManager

分類Dev

The method executeMethod(GetMethod) is undefined for the type HttpClient

分類Dev

The method getTexttActivity(Intent) is undefined for the type EditText

分類Dev

The Method values() is undefined for the type String Error

分類Dev

How to pass undefined number of type arguments to generic method?

分類Dev

The method extractAll(String) is undefined for the type ZipFile with zip4j

分類Dev

Android Ksoap2 : The method setName(String) is undefined for the type PropertyInfo

分類Dev

The method getTeamName() is undefined for the type ArrayList<Team> - Error code, Java

分類Dev

Why i cannot call Set method with Optional<> :the method setName is undefined for the type Optional?

分類Dev

error - "Method Range.getValue is heavily used by the script"

分類Dev

Java Method Example clarification

分類Dev

Ruby enumerable method example

分類Dev

Golang Gin "c.Param undefined(type * gin.Context has no field or method Param)"

分類Dev

body.Read undefined (type *io.ReadCloser has no field or method Read)

分類Dev

Rails undefined method

分類Dev

Undefined method 'pluralize' for #<Controller>

分類Dev

Undefined Method in Request::all()

分類Dev

Test for NoMethodError: undefined method

分類Dev

Rspec undefined method 'to'

分類Dev

PDO fetchAll method undefined

分類Dev

ReactorClientHttpConnector((<no type> opt) -> {}) is undefined

分類Dev

Required but possibly undefined type

分類Dev

Use of undefined type

分類Dev

Undefined type in JavaScript

分類Dev

ビルドエラー「rows.Columns undefined(type * sql.Row has no field or method Columns)」

分類Dev

ビルドエラー「db.GetUsers undefined(type * gorm.DB has no field or method GetUsers)」

分類Dev

Rails, undefined method in Class but method is present

分類Dev

Undefined method for `before_filter'

Related 関連記事

  1. 1

    The method and() is undefined for the type HttpSecurity

  2. 2

    The method getinstance(Context) is undefined for the type AccessibilityManager

  3. 3

    The method executeMethod(GetMethod) is undefined for the type HttpClient

  4. 4

    The method getTexttActivity(Intent) is undefined for the type EditText

  5. 5

    The Method values() is undefined for the type String Error

  6. 6

    How to pass undefined number of type arguments to generic method?

  7. 7

    The method extractAll(String) is undefined for the type ZipFile with zip4j

  8. 8

    Android Ksoap2 : The method setName(String) is undefined for the type PropertyInfo

  9. 9

    The method getTeamName() is undefined for the type ArrayList<Team> - Error code, Java

  10. 10

    Why i cannot call Set method with Optional<> :the method setName is undefined for the type Optional?

  11. 11

    error - "Method Range.getValue is heavily used by the script"

  12. 12

    Java Method Example clarification

  13. 13

    Ruby enumerable method example

  14. 14

    Golang Gin "c.Param undefined(type * gin.Context has no field or method Param)"

  15. 15

    body.Read undefined (type *io.ReadCloser has no field or method Read)

  16. 16

    Rails undefined method

  17. 17

    Undefined method 'pluralize' for #<Controller>

  18. 18

    Undefined Method in Request::all()

  19. 19

    Test for NoMethodError: undefined method

  20. 20

    Rspec undefined method 'to'

  21. 21

    PDO fetchAll method undefined

  22. 22

    ReactorClientHttpConnector((<no type> opt) -> {}) is undefined

  23. 23

    Required but possibly undefined type

  24. 24

    Use of undefined type

  25. 25

    Undefined type in JavaScript

  26. 26

    ビルドエラー「rows.Columns undefined(type * sql.Row has no field or method Columns)」

  27. 27

    ビルドエラー「db.GetUsers undefined(type * gorm.DB has no field or method GetUsers)」

  28. 28

    Rails, undefined method in Class but method is present

  29. 29

    Undefined method for `before_filter'

ホットタグ

アーカイブ