You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Erwin Hogeweg <er...@me.com> on 2020/01/10 18:40:16 UTC

jaas:su appears to default to 1st realm

Hi -

I stumbled upon this exception with 4.2.6 and I am not sure if that is expected or not. I am logged into the client as default ‘karaf’ user. From there I try to su to admin user which is specified in the database through the JDBC realm. That doesn’t appear to work and I am wondering if it is supposed to.

Cheers,

Erwin


karaf@root()> jaas:whoami
Name
─────
karaf

karaf@root()> jaas:realm-list 
Index │ Realm Name │ Login Module Class Name
──────┼────────────┼───────────────────────────────────────────────────────────────
1     │ karaf      │ org.apache.karaf.jaas.modules.properties.PropertiesLoginModule
2     │ karaf      │ org.apache.karaf.jaas.modules.publickey.PublickeyLoginModule
3     │ karaf      │ org.apache.karaf.jaas.modules.audit.FileAuditLoginModule
4     │ karaf      │ org.apache.karaf.jaas.modules.audit.LogAuditLoginModule
5     │ karaf      │ org.apache.karaf.jaas.modules.audit.EventAdminAuditLoginModule
6     │ wxyz       │ org.apache.karaf.jaas.modules.jdbc.JDBCLoginModule
karaf@root()> jaas:realm-manage --index 6

karaf@root()> jaas:user-list 
User Name                 │ Group │ Role
──────────────────────────┼───────┼─────────
aap@tomatoes.com          │       │ INVESTOR
admin                     │       │ ADMIN

karaf@root()> jaas:su admin
Password: ************
[Karaf local console user karaf] ERROR org.apache.karaf.shell.support.ShellUtil - Exception caught while executing command
javax.security.auth.login.FailedLoginException: login failed
	at org.apache.karaf.jaas.modules.properties.PropertiesLoginModule.login(PropertiesLoginModule.java:115)
	at org.apache.karaf.jaas.boot.ProxyLoginModule.login(ProxyLoginModule.java:83)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)


Re: jaas:su appears to default to 1st realm

Posted by Erwin Hogeweg <er...@me.com>.
Please ignore… I missed the —realm parameter on the su command.

Erwin


> On Jan 10, 2020, at 13:40, Erwin Hogeweg <er...@me.com> wrote:
> 
> Hi -
> 
> I stumbled upon this exception with 4.2.6 and I am not sure if that is expected or not. I am logged into the client as default ‘karaf’ user. From there I try to su to admin user which is specified in the database through the JDBC realm. That doesn’t appear to work and I am wondering if it is supposed to.
> 
> Cheers,
> 
> Erwin
> 
> 
> karaf@root()> jaas:whoami
> Name
> ─────
> karaf
> 
> karaf@root()> jaas:realm-list 
> Index │ Realm Name │ Login Module Class Name
> ──────┼────────────┼───────────────────────────────────────────────────────────────
> 1     │ karaf      │ org.apache.karaf.jaas.modules.properties.PropertiesLoginModule
> 2     │ karaf      │ org.apache.karaf.jaas.modules.publickey.PublickeyLoginModule
> 3     │ karaf      │ org.apache.karaf.jaas.modules.audit.FileAuditLoginModule
> 4     │ karaf      │ org.apache.karaf.jaas.modules.audit.LogAuditLoginModule
> 5     │ karaf      │ org.apache.karaf.jaas.modules.audit.EventAdminAuditLoginModule
> 6     │ wxyz       │ org.apache.karaf.jaas.modules.jdbc.JDBCLoginModule
> karaf@root()> jaas:realm-manage --index 6
> 
> karaf@root()> jaas:user-list 
> User Name                 │ Group │ Role
> ──────────────────────────┼───────┼─────────
> aap@tomatoes.com <ma...@tomatoes.com>          │       │ INVESTOR
> admin                     │       │ ADMIN
> 
> karaf@root()> jaas:su admin
> Password: ************
> [Karaf local console user karaf] ERROR org.apache.karaf.shell.support.ShellUtil - Exception caught while executing command
> javax.security.auth.login.FailedLoginException: login failed
> 	at org.apache.karaf.jaas.modules.properties.PropertiesLoginModule.login(PropertiesLoginModule.java:115)
> 	at org.apache.karaf.jaas.boot.ProxyLoginModule.login(ProxyLoginModule.java:83)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>