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

Piotr Klimczak commented on CXF-5118:
-------------------------------------

There is just one misunderstanding left- but very important.
For better understanding forget about TLSUserToken for a while.

So when HTTP Authentication is used, then AuthorizationPolicy is created with 
user supplied credentials to do JAAS stuff later on- to authenticate with 
JAASLoginInterceptor. This is possibly main reason why JAASLoginInterceptor was 
created- to work with user supplied credentials.
So if we want to use for example AuthorizationPolicy for TLS Authentication 
too, then *YES* we will overwrite user supplied credentials.
I already tested it so I am 100% sure what I am writing here and I do not think 
this is what we want to do.
Of course we can implement logic, to check is there already AuthorizationPolicy 
or SecurityToken or etc. but it will be error prone in future and I would like 
to avoid it.

I do not know yet what would be inside TLSUserToken and how it will be working 
with CertificateMapper, but I know that it is really good idea *NOT* to use 
AuthenticationPolicy or UsernameToken.

Also as I wrote: finally I think we should not create JAAS Mutual 
authentication feature as simply those technologies do not fit together. We are 
rather about to create something that helps to retrieve roles from somewhere, 
and JAAS is just an option.

Would be happy to receive just last feedback after my above update.

Hope you find it well.
And really HUGH thanks for whole above conversation.
This is simply whole about how to create best solutions :)

Piotr Klimczak

> 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