Custom Elytron Realm

335 views
Skip to first unread message

eng.dan...@gmail.com

unread,
Jun 30, 2021, 5:19:44 AM6/30/21
to WildFly
Hi,

I'm trying to migrate a custom login module (picketlink) to a Elytron Realm.

My current custom login module is an extension of DatabaseLoginModule and currently supports login fail count, user account lock after X tries and registers last successfull login.

Whats the best way to migrate this functionnality to Elytron?

Extending JdbcSecurityRealm? Implementing SecurityRealm?

Thanks.

Farah Juma

unread,
Jun 30, 2021, 12:57:25 PM6/30/21
to WildFly
You'll likely want to create a custom Elytron realm that extends the JdbcSecurityRealm. Some more information on implementing a custom Elytron realm can be found here:

Cesar Rodriguez

unread,
Jul 8, 2021, 12:14:35 PM7/8/21
to WildFly
Hi Daniel,

I created a class that implements RealmIdentity. That class Overwrites the "verifyEvidence (Evidence evidence)" method, and in that method I make the verifications you mention: "login fail count, user account lock after X tries and registers last successfull login.". Then I propagate the Exception information to my Servlet using the "ThreadLocal" class (If you find a better way to propagate that exception, I'd like to know)

In my case I also have a custom class that implements Principal. I don't know if this is your case. This require that you implements a PrincipalTransformer.

This Link explains how to configure the custom RealmIdentity.

Regards 
Reply all
Reply to author
Forward
0 new messages