Elytron JAAS - Properties from client

108 views
Skip to first unread message

Lucas dahlgren

unread,
Oct 6, 2022, 10:46:03 AM10/6/22
to WildFly
We have created an Elytron JAAS authentication in Widlfly 26.1. The guide followed is:
https://wildfly-security.github.io/wildfly-elytron/blog/jaas-realm/

The authentication works perfectly and the callerprincipal and the correct roles are sent to the Wildfly instance. But no I can't find the solution to my problem. The problem is that besides Password and Username our authentication requires an clientid as well. This ID is set in the client which isn''t a part of the Wildfly instance. 

Does anyone have any solutions how to propagate additional user data besides the username, credentials and to the login-module?

Diana Krepinska

unread,
Oct 20, 2022, 1:21:34 PM10/20/22
to WildFly
Hi, if you are asking how to use some additional information in order to authenticate, you might want to check if custom authentication mechanism http://darranl.blogspot.com/2018/02/wildfly-elytron-implementing-custom.html would address your problem.

But if you ar asking about how to obtain additional information about the identity in the application, you can use attributes of security identity. In the applicaiton you can use SecurityDomain.getCurrent().getIdentity(Principal principal); to obtain a security identity and use getAttributes() to obtain its attributes. To associate the attributes in the login module, just add those as an additional principal of the Subject as mentioned in the blog post.



Reply all
Reply to author
Forward
0 new messages