[undertow-dev] Make Credential on IdentityManager be a generic parameter

Miere Teixeira miere.teixeira at gmail.com
Tue Jul 29 08:17:26 EDT 2014


Hi devs,
how you doing?

I was checking out the security API proposed by Undertow and I've
identified that io.undertow.security.idm.IdentityManager receive an empty
credential as parameter in two of its methods. After taking a look into the
Java Docs and the exemple codes I figure out why.

As proposed in the original design, an IdentityManager should know which
kind of credential was created by the AuthenticationMechanism, cast it, and
then apply the desired identity match. It means that there's an existance
relation between both IdentityManager and AuthenticationMechanism.

Maybe, making Credential a generic parameter of IdentityManager it will
make IdentityManager more plugable. It also forces us the improve
SecurityContext with this new design.

A little sample copied from BasicAuthenticationMechanism.java[106~110] as
an exemple.

final IdentityManager<PasswordCredential> idm =
> securityContext.getIdentityManagerFor( PasswordCredential.class );
> final PasswordCredential credential = new PasswordCredential(password);
> try {
>     final AuthenticationMechanismOutcome result;
>     Account account = idm.verify(userName, credential);
>

Let me know if this makes sense for Undertow needs!

Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140729/7e1010c9/attachment.html 


More information about the undertow-dev mailing list