[ 
https://issues.apache.org/jira/browse/CXF-5118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14084470#comment-14084470
 ] 

Sergey Beryozkin commented on CXF-5118:
---------------------------------------

Hi Piotr, I guess it is becoming a bit more complex than it should be, just 
consider moving the X509Cert code out of the interceptor; also, returning 
NamePasswordCallbackHandler is problematic for the reasons I outlined above, 
there were issues using it in a system test I referred to earlier to until 
NamePasswordCallbackHandler was enhanced but the problem may still persists 
with some other containers so just let return the existing  'pair of 
properties' class. If a password-less login is expected than the mapper would 
simply not provide the password property, as simple as that.

Hi Christian, returning a String only from the mapper would imply the solution 
would likely work only with a modified Karaf Login module, but IMHO the 
solution should work with the modules which can not be modified, and in a 
non-Karaf environments too. As I mentioned above, the mapper not willing to 
provide a password would not provide it, the password property would be set to 
null. As a side note I think loading a JAAS module accepting no passwords into 
a container JVM is not secure, but if it is considered OK in some scenarios 
then as I said the mapper will not worry about the passwords :-) and in cases 
where it is essential to supply a password the mapper will get it, decrypting 
it if needed...

Sergey    

> Create CXF interceptor which will use HTTPS client certificates to create 
> JAAS SecurityContext 
> -----------------------------------------------------------------------------------------------
>
>                 Key: CXF-5118
>                 URL: https://issues.apache.org/jira/browse/CXF-5118
>             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 roles)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to