Custom login module in ear

857 views
Skip to first unread message

J.B.A.

unread,
Mar 30, 2022, 4:49:35 AM3/30/22
to WildFly

Hi all,

I used to have a custom login module class in my ear which was loaded conveniently via the deprecated org.jboss.as.security module:

<subsystem xmlns="urn:jboss:domain:security:1.2">
    <security-domains>
        <security-domain name="MyDomain">
            <authentication>
                <login-module code="my.example.package.CustomLoginModule" flag="required"/>
            </authentication>
        </security-domain>
    </security-domains>
</subsystem>

After migrating to WildFly 26, I am trying to setup the same login module by following this guide. However, the custom login module doesn't seem to be detected. When trying to add a custom callback handler, just like in the guide, I get a java.lang.IllegalStateException: WFLYELY00045: Failed to load CallbackHandler from the provided module.

I suppose this is because I deploy the CustomLoginModule in an ear instead of adding it as a module. Is there any way to load it from the deployment?

Diana Krepinska

unread,
Mar 30, 2022, 10:55:00 AM3/30/22
to WildFly
Hello, the custom login module must be added as a wildfly module, it cannot be loaded from deployment.

Jayant Nahar

unread,
Dec 5, 2023, 11:38:17 AM12/5/23
to WildFly
I'm also facing the same issue, even with adding login module as WF module.

Can someone please help resolve the issue?

Thank you in Advanced...!!
-------------------------------------------

Jayant Nahar

unread,
Dec 5, 2023, 11:38:17 AM12/5/23
to WildFly
Hello experts,

I did try to add custom login module as wildfly module, like
module add --name=lm --resources=path/to/custommodule/CustomLoginodule.jar --dependencies=org.wildfly.security.elytron

And added it to global modules as well, like
/subsystem=ee:list-add(name=global-modules,value={name=lm})

The custom module has custom callback handler, but still I get the same error as above (WFLYELY00045: Failed to load CallbackHandler from the provided module) while running below command.
/subsystem=elytron/jaas-realm=myRealm:add(entry=test,path=./conf/jaas.config,module=lm,callback-handler=com.main.login.CustomCallbackHandler)

Can someone please help resolve this issue? I'm really stuck here.

Thank you in advanced..!!

---------------------------------------------

On Wednesday, March 30, 2022 at 8:25:00 PM UTC+5:30 Diana Krepinska wrote:

Ashok Ilapavluri

unread,
Dec 11, 2023, 5:25:34 PM12/11/23
to WildFly
I am also facing exactly the same issue, can someone please respond.

Thanks
Ashok.

Pep Grifell

unread,
Dec 13, 2023, 1:26:28 AM12/13/23
to WildFly
Hello,

I did this to migrate my custom login to Elytron:


Hope it helps.

Regards,
pep


El dia dilluns, 11 de desembre del 2023 a les 23:25:34 UTC+1, Ashok Ilapavluri va escriure:

Diana Krepinska

unread,
Dec 13, 2023, 3:18:26 PM12/13/23
to WildFly
Hello,

I see your example command:

/subsystem=elytron/jaas-realm=myRealm:add(entry=test,path=./conf/jaas.config,module=lm,callback-handler=com.main.login.CustomCallbackHandler)

uses a relative "path". You should rewrite it to use a "relative-to" attribute or provide a full path. And is the com.main.login.CustomCallbackHandler class present in the CustomLoginodule.jar  ?

Diana Krepinska

unread,
Dec 13, 2023, 4:09:52 PM12/13/23
to WildFly
If you want to use a default callback-handler provided by wildfly, you can just omit this attribute.

David Carricajo

unread,
Dec 18, 2023, 5:20:05 AM12/18/23
to Diana Krepinska, WildFly
Diana, what if you still want to use a custom login module but access to EJB is needed for authentication?
is this the way to go or is there any other option?

--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/f4ffa352-97d1-497c-bb0f-ffdbfb6303abn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages