GithubHelp home page GithubHelp logo

Failed to define class com.hfx.keycloak.spi.ResetCredentialWithPhone in Module "deployment.phone.jar" about keycloak-phone-authenticator HOT 5 CLOSED

fx-hao avatar fx-hao commented on August 15, 2024
Failed to define class com.hfx.keycloak.spi.ResetCredentialWithPhone in Module "deployment.phone.jar"

from keycloak-phone-authenticator.

Comments (5)

FX-HAO avatar FX-HAO commented on August 15, 2024

You cannot put your jar into the standalone/deployments folder, it's called hot deployment. you need to register it using Modules. Or you can take at look at my example Dockerfile.

My example Dockerfile:

# base image
FROM jboss/keycloak:9.0.2

# copy the jars into the current folder
COPY --from=builder /app/keycloak-phone-authenticator/target/keycloak-phone-authenticator-1.0.0-SNAPSHOT.jar .
COPY --from=builder /app/keycloak-phone-authenticator-yuntongxun-sms/target/keycloak-phone-authenticator-yuntongxun-sms-1.0.0-SNAPSHOT.jar .
COPY --from=builder /app/yuntongxun4j/target/yuntongxun4j-1.0-SNAPSHOT.jar .
COPY examples/cli/ cli/

# register the jars
RUN $JBOSS_HOME/bin/jboss-cli.sh --file=cli/keycloak-phone-authenticator-yuntongxun-sms-config.cli
RUN $JBOSS_HOME/bin/jboss-cli.sh --file=cli/module-add.cli

# copy the resource files into the current folder
COPY --from=builder /app/keycloak-phone-authenticator/target/classes/theme-resources/templates/ $JBOSS_HOME/themes/base/login/
COPY ./messages/ messages/

# fix a bug
RUN rm -rf /opt/jboss/keycloak/standalone/configuration/standalone_xml_history/current

# register the resource files
RUN cat messages/messages_en.properties >> $JBOSS_HOME/themes/base/login/messages/messages_en.properties && \
    cat messages/messages_zh_CN.properties >> $JBOSS_HOME/themes/base/login/messages/messages_zh_CN.properties && \
    cat messages/messages_en.properties >> $JBOSS_HOME/themes/base/account/messages/messages_en.properties && \
    cat messages/messages_zh_CN.properties >> $JBOSS_HOME/themes/base/account/messages/messages_zh_CN.properties

#6 is related to this and can answer your questions.

from keycloak-phone-authenticator.

SlausB avatar SlausB commented on August 15, 2024

Thank you for the instant response!
Seems I managed to adapt Dockerfile to my Keycloak setup, but on user login page An internal server error has occurred message shown and Keycloak outputs to console:

  | 12:44:41,754 ERROR [freemarker.runtime] (default task-2) Error executing FreeMarker template: freemarker.core._MiscTemplateException: Macro "registrationLayout" has no parameter with name "displayWide".
  | 
  | ----
  | FTL stack trace ("~" means nesting-related):
  |      - Failed at: #macro registrationLayout bodyClass="...  [in template "template.ftl" in macro "registrationLayout" at line 1, column 1]
  |      - Reached through: @layout.registrationLayout displayInf...  [in template "login-with-phone.ftl" at line 2, column 1]
  | ----
  |      at [email protected]//freemarker.core.Environment.setMacroContextLocalsFromArguments(Environment.java:921)
  |      at [email protected]//freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:854)
  |      at [email protected]//freemarker.core.Environment.invokeMacro(Environment.java:809)
  |      at [email protected]//freemarker.core.UnifiedCall.accept(UnifiedCall.java:83)
  |      at [email protected]//freemarker.core.Environment.visit(Environment.java:331)
  |      ...

I have everything set up for version keycloak/keycloak:13.0.0. Maybe keycloak-phone-authenticator not supposed to work with version 13? Or I am doing something wrong? Thanks in advance.

from keycloak-phone-authenticator.

FX-HAO avatar FX-HAO commented on August 15, 2024

I haven't tried this with Keycloak 13. When I tried to build keycloak 13.0.1 locally, I got some errors like this. Hmmm... I haven't fixed it, let me try it tomorrow.

from keycloak-phone-authenticator.

FX-HAO avatar FX-HAO commented on August 15, 2024

Hi, I just released a new version to support Keycloak 13. Could you please test if it solves your problems? Let me know if anything wrong. thank you.

from keycloak-phone-authenticator.

SlausB avatar SlausB commented on August 15, 2024

It worked! Thank you very much!

from keycloak-phone-authenticator.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.