cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <>
Subject [jira] [Commented] (CXF-5118) Create CXF interceptor which will use HTTPS client certificates to create JAAS SecurityContext
Date Thu, 07 Aug 2014 14:10:12 GMT


Sergey Beryozkin commented on CXF-5118:

Hi Christian

DefaultSecurityContext does need a 'name'. There was a reason it was added (I or may be Colm
did it on request), as far as I recall in some cases DefaultSecurityContext needs a hint to
figure where is an actual Principal.

Other than that I'm personally ready to settle for your code proposal. The minor thing: IMHO
having one CallbackProvider for AuthorizationPolicy and one for UsernameToken is redundant:
as I said no ordering or any other specific code paths (ex, AuthPolicy - for Basic, UsernameToken
- for WS Sec) is implied, I can honestly say it because I added that code and I'm still blaming
myself for not making WSS4JInInterceptor simply reuse AuthorizationPolicy :-). A custom non-WS
CXF interceptor can wrap the user credentials in a UsernameToken if preferred. So, why don't
we have a single default provider checking AuthPolicy and UsernameToken.

Up to you, but it would make it a bit simpler I'd say. The open question is how to make a
username visible to the DefaultSecurityContext - this was not an issue with your previous
code version. So if you prefer to keep the current version then may CallbackProvider would
return Callback extensions keeping the name.

Thanks, Sergey 

> 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