cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Piotr Klimczak (JIRA)" <>
Subject [jira] [Commented] (CXF-5118) Create CXF interceptor which will use HTTPS client certificates to create JAAS SecurityContext
Date Mon, 04 Aug 2014 08:50:12 GMT


Piotr Klimczak commented on CXF-5118:

Morning Sergey!

Yes, it looks like we are closer to our perfect solution.
CertificateMapper is used in line 138:

         CallbackHandler handler;
         if (name != null && password != null) {
             handler = getCallbackHandler(name, password);
         } else if (name != null && certificate != null) {
             handler = certificateMapper.toNamePassword(name, certificate);
         } else {
             throw new AuthenticationException("Authentication required but no user or password
was supplied");

The reason why I am not using AuthorizationPolicy nor UsernameToken is that in later logic
it requires to provide both: username and password.
And as you know I would like to give ability to do passwordless authentication, but without
changing currently implemented verification logic.

I used NamePasswordCallbackHandler because you wanted to reuse it, but now I think you meant
something else.

If we are OK to introduce new token type, then I think it would be better to create new interceptor,
that can work together with JAASLoginInterceptor or not if user do not want to.
The thing is that if it will be introduced as a new Interceptor, then user will be free to
use JAASLoginInterceptor or his own impl. or both together (for example changing interceptor
chain for a message) or whatever he want to.

The question is: are we ok to force user to add two interceptors OR we can provide TLSJAASAuthenticationFeature,
that will add both of them for user.

So as I wrote I think that right now we are closer to not implement this functionality in
Would be very thankful to receive feedback about above assumption.

Thanks in advance.

> Create CXF interceptor which will use HTTPS client certificates to create JAAS SecurityContext

> -----------------------------------------------------------------------------------------------
>                 Key: CXF-5118
>                 URL:
>             Project: CXF
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sergey Beryozkin
>            Assignee: Christian Schneider
> Use case:
> The user authenticates against the webservice using an X509 client certificate. In case
of successful authentication the JAAS security context should be populated with a Subject
that stores the user name and the roles of the user. This is necessary to support Authorization
at a later stage.
> Design ideas
> The SSL transport will be configured to only accept certain client certificates. So we
can assume that the interceptor does not have to do a real authentication. Instead it has
to map from the subjectDN of the certificate to the user name and then lookup the roles of
that user. Both then has to be stored in the subject's principles.
> The mapping could be done inside a JAASLoginModule or before. Inside will give the user
more flexibility.
> The next step to retrieve the roles should be done in one of the standard JAASLoginModules
as the source of the roles can be quite diverse. So for example the LdapLoginModule allows
to retrieve the roles from Ldap. At the moment these modules require the password of the user
though which is not available when doing a cert based auth.
> So I see two variants to retrieve the roles:
> 1. Change the loginmodules like the LDAP one to be configureable to use a fixed ldap
user for the ldap connect and not require the user password. So the module would have two
modes: a) normal authentication and group gathering b) use a fixed user to just retrieve roles
for a given user
> 2. Store the user password somewhere (e.g. in the mapping file). In this case the existing
LDAPLoginModule could be used but the user password would be openly in a text file
> 3. Create new LoginModules with the desired behaviour (fixed user and only lookup of

This message was sent by Atlassian JIRA

View raw message