You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by cniehues <ch...@its-telco.de> on 2016/08/29 09:10:43 UTC

How to add a new JAAS realm in karafa 4.0.5

Hi,

I would like to know how to define a new JAAS realm in karaf. The
documentation says: "You can manage an existing realm, login module, or
create your own realm using the jaas:realm-manage command." but something
like "jaas:realm-manage --realm myrealm" doesn't work.

I would also like to know to define a JAAS realm configuration in a feature
file.

Thanks
Christian



--
View this message in context: http://karaf.922171.n3.nabble.com/How-to-add-a-new-JAAS-realm-in-karafa-4-0-5-tp4047729.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: How to add a new JAAS realm in karafa 4.0.5

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Maybe you have multiple blueprint in the same bundle or reference as we 
can see:

'http://cxf.apache.org/configuration/beans' namespace in the log

Maybe a <import/> somewhere ?

Regards
JB

On 08/29/2016 02:05 PM, cniehues wrote:
> I used the example from the documentation:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>            xmlns:jaas="http://karaf.apache.org/xmlns/jaas/v1.0.0"
>
> xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
>
>
>     <ext:property-placeholder placeholder-prefix="$["
> placeholder-suffix="]"/>
>
>     <jaas:config name="myrealm">
>         <jaas:module
> className="org.apache.karaf.jaas.modules.properties.PropertiesLoginModule"
>                      flags="required">
>             users = $[karaf.base]/etc/users.properties
>         </jaas:module>
>     </jaas:config>
>
> </blueprint>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/How-to-add-a-new-JAAS-realm-in-karaf-4-0-5-tp4047729p4047739.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: How to add a new JAAS realm in karafa 4.0.5

Posted by cniehues <ch...@its-telco.de>.
I used the example from the documentation:

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:jaas="http://karaf.apache.org/xmlns/jaas/v1.0.0"
          
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">

    
    <ext:property-placeholder placeholder-prefix="$["
placeholder-suffix="]"/>

    <jaas:config name="myrealm">
        <jaas:module
className="org.apache.karaf.jaas.modules.properties.PropertiesLoginModule"
                     flags="required">
            users = $[karaf.base]/etc/users.properties
        </jaas:module>
    </jaas:config>

</blueprint>



--
View this message in context: http://karaf.922171.n3.nabble.com/How-to-add-a-new-JAAS-realm-in-karaf-4-0-5-tp4047729p4047739.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: How to add a new JAAS realm in karafa 4.0.5

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

your blueprint XML doesn't look good in term of namespace definition.

Check the xmlns definition.

Regards
JB

On 08/29/2016 01:08 PM, cniehues wrote:
> Ok, if I drop the example blueprint from
> http://karaf.apache.org/manual/latest/#_security_framework in the karaf
> deploy folder the realm is available, but when I integrate it in a bundle I
> get following exception:
>
> 2016-08-29 12:51:01,529 | ERROR | nsole user karaf | BlueprintContainerImpl
> | 13 - org.apache.aries.blueprint.core - 1.6.1 | Unable to start blueprint
> container for bundle pra-osgi-ws/1.0.0.SNAPSHOT
> org.xml.sax.SAXParseException: src-import.3.1: The namespace attribute,
> 'http://cxf.apache.org/configuration/beans', of an <import> element
> information item must be identical to the targetNamespace attribute,
> 'http://karaf.apache.org/xmlns/jaas/v1.1.0', of the imported document.
>
> An idea how to fix this?
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/How-to-add-a-new-JAAS-realm-in-karaf-4-0-5-tp4047729p4047735.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: How to add a new JAAS realm in karafa 4.0.5

Posted by cniehues <ch...@its-telco.de>.
Ok, if I drop the example blueprint from
http://karaf.apache.org/manual/latest/#_security_framework in the karaf
deploy folder the realm is available, but when I integrate it in a bundle I
get following exception:

2016-08-29 12:51:01,529 | ERROR | nsole user karaf | BlueprintContainerImpl          
| 13 - org.apache.aries.blueprint.core - 1.6.1 | Unable to start blueprint
container for bundle pra-osgi-ws/1.0.0.SNAPSHOT
org.xml.sax.SAXParseException: src-import.3.1: The namespace attribute,
'http://cxf.apache.org/configuration/beans', of an <import> element
information item must be identical to the targetNamespace attribute,
'http://karaf.apache.org/xmlns/jaas/v1.1.0', of the imported document.

An idea how to fix this?



--
View this message in context: http://karaf.922171.n3.nabble.com/How-to-add-a-new-JAAS-realm-in-karaf-4-0-5-tp4047729p4047735.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: How to add a new JAAS realm in karafa 4.0.5

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
The user guide is more show and interact (even if it's very limited) 
with the realms.

The dev guide is more to create and tweak the realms.

Regards
JB

On 08/29/2016 11:26 AM, cniehues wrote:
> Thanks JB. So I think I will have to get used to the differences between
> "User Guide" and "Administration Guide" because I looked here:
> http://karaf.apache.org/manual/latest/#_realms
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/How-to-add-a-new-JAAS-realm-in-karaf-4-0-5-tp4047729p4047731.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: How to add a new JAAS realm in karafa 4.0.5

Posted by cniehues <ch...@its-telco.de>.
Thanks JB. So I think I will have to get used to the differences between
"User Guide" and "Administration Guide" because I looked here:
http://karaf.apache.org/manual/latest/#_realms



--
View this message in context: http://karaf.922171.n3.nabble.com/How-to-add-a-new-JAAS-realm-in-karaf-4-0-5-tp4047729p4047731.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: How to add a new JAAS realm in karafa 4.0.5

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Christian,

you can provision a blueprint XML where you can use <jaas:config/> 
namespace:

http://karaf.apache.org/manual/latest/#_security_framework

Regards
JB

On 08/29/2016 11:10 AM, cniehues wrote:
> Hi,
>
> I would like to know how to define a new JAAS realm in karaf. The
> documentation says: "You can manage an existing realm, login module, or
> create your own realm using the jaas:realm-manage command." but something
> like "jaas:realm-manage --realm myrealm" doesn't work.
>
> I would also like to know to define a JAAS realm configuration in a feature
> file.
>
> Thanks
> Christian
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/How-to-add-a-new-JAAS-realm-in-karafa-4-0-5-tp4047729.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com