Freeman Fang created CXF-6786:
---------------------------------

             Summary: avoid Error log from NamePasswordCallbackHandler
                 Key: CXF-6786
                 URL: https://issues.apache.org/jira/browse/CXF-6786
             Project: CXF
          Issue Type: Improvement
            Reporter: Freeman Fang


If we deploy a cxf rest endpoint in karaf with JAAS enabled, we get Error 
message like
{code}
2016-02-09T09:05:26.515-0600 | ERROR | qtp1245173695-70 | 
NamePasswordCallbackHandler | 74 - org.apache.cxf.cxf-core - 3.0.4 | ... | 
Unsupported callback type 
org.apache.karaf.jaas.modules.publickey.PublickeyCallback

This is because by default Karaf enable multiple jaas modules, like
{code}
<jaas:config name="karaf">
        <jaas:module 
className="org.apache.karaf.jaas.modules.properties.PropertiesLoginModule" 
flags="optional">
            users = $[karaf.etc]/users.properties
            detailed.login.exception = ${detailed.login.exception}
            encryption.name = ${encryption.name}
            encryption.enabled = ${encryption.enabled}
            encryption.prefix = ${encryption.prefix}
            encryption.suffix = ${encryption.suffix}
            encryption.algorithm = ${encryption.algorithm}
            encryption.encoding = ${encryption.encoding}
        </jaas:module>
        <jaas:module 
className="org.apache.karaf.jaas.modules.publickey.PublickeyLoginModule" 
flags="optional">
            users = $[karaf.etc]/keys.properties
            detailed.login.exception = ${detailed.login.exception}
        </jaas:module>
        <jaas:module 
className="org.apache.karaf.jaas.modules.audit.FileAuditLoginModule" 
flags="optional">
            enabled = ${audit.file.enabled}
            file = ${audit.file.file}
        </jaas:module>
        <jaas:module 
className="org.apache.karaf.jaas.modules.audit.EventAdminAuditLoginModule" 
flags="optional">
            enabled = ${audit.eventadmin.enabled}
            topic = ${audit.eventadmin.topic}
        </jaas:module>
    </jaas:config>
{code}
So when the JAAS try the PublickeyLoginModule, the 
org.apache.karaf.jaas.modules.publickey.PublickeyCallback would be passed into 
CXF NamePasswordCallbackHandler which cause this Error log. As this is actually 
harmless because the "AA" passed using PropertiesLoginModule, we should lower 
this message level



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to