Description
When running a post-boot-command file, creating a auth-relam is not working properly. (in docker container)
I'm able to create some JDBC connection pools, registering some system properties, but creating a custom authentication-realm is not possible.
Expected Outcome
The commands are executed successfully, in these specific cases: authentication realm with sql statements as one or more properties properties.
It's also expected that the same command, tested with asadmin multimode, works in a postbootcommandfile, but it's not true.
Current Outcome
The log reports "This parameter may not have more than one value." when running using a post-boot-command file
`[2019-08-26T05:02:56.870+0000] [Payara 5.192] [SEVERE] [NCLS-CORE-00003] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1566795776870] [levelValue: 1000] [[
Exception while running a command
org.glassfish.common.util.admin.UnacceptableValueException: Invalid parameter: authrealmname. This parameter may not have more than one value.
at org.glassfish.common.util.admin.MapInjectionResolver.convertListToObject(MapInjectionResolver.java:405)
at org.glassfish.common.util.admin.MapInjectionResolver.getValue(MapInjectionResolver.java:136)
at org.jvnet.hk2.config.InjectionManager.syncDoInject(InjectionManager.java:170)
at org.jvnet.hk2.config.InjectionManager.inject(InjectionManager.java:74)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.injectParameters(CommandRunnerImpl.java:386)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1242)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:119)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1865)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1741)
at com.sun.enterprise.admin.cli.embeddable.CommandExecutorImpl.executeCommand(CommandExecutorImpl.java:172)
at com.sun.enterprise.admin.cli.embeddable.CommandExecutorImpl.run(CommandExecutorImpl.java:96)
at fish.payara.boot.runtime.BootCommand.execute(BootCommand.java:69)
at fish.payara.boot.runtime.BootCommands.executeCommands(BootCommands.java:110)
at fish.payara.boot.runtime.BootCommands.executeCommands(BootCommands.java:104)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.doBootCommands(GlassFishMain.java:294)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:133)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:109)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54)
]]
[2019-08-26T05:02:56.882+0000] [Payara 5.192] [WARNING] [] [fish.payara.boot.runtime.BootCommand] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1566795776882] [levelValue: 900] [[
Boot Command create-auth-realm failed PlainTextActionReporterFAILUREorg.glassfish.common.util.admin.UnacceptableValueException: Invalid parameter: authrealmname. This parameter may not have more than one value.Description: create-auth-realm commandInvalid parameter: authrealmname. This parameter may not have more than one value.
Usage: create-auth-realm --classname=classname [--property=property] [--target=server] [--login-module=login-module] authrealmname
]]
`
Steps to reproduce (Only for bug reports)
asAdmin command
Please note that in My case I do use a custom class. I chose here a 'FileRealm' to demonstrate my issue
create-auth-realm --classname=com.sun.enterprise.security.auth.realm.file.FileRealm --target=server-config --property java.naming.referral=ignore:jaas-context=myMontovaRealm:datasource.jndi=jdbc/SomeJDBC:sql.password="SELECT u.password FROM users u WHERE u.email \= ? AND u.active \= true":sql.groups="SELECT SOME OTHER SQL":sql.impersonate_user="YET ANOTHER":sql.token="SELECT r.token FROM rememberme_token r WHERE r.email \= ? AND r.token \= ?":search-bind-dn=TestUser:search-bind-password=Password:directory=DummyDir:base-dn="DC\=company,DC\=com":file=testFile myRealm
When running this command in multimode
PS Desktop\payara-5.192\payara5\bin> .\asadmin create-auth-realm --classname=com.sun.enterprise.security.auth.realm.file.FileRealm --target=server-config --property java.naming.referral=ignore:jaas-context=myMontovaRealm:datasource.jndi=jdbc/SomeJDBC:sql.password="SELECT u.password FROM users u WHERE u.email \= ? AND u.active \= true":sql.groups="SELECT SOME OTHER SQL":sql.impersonate_user="YET ANOTHER":sql.token="SELECT r.token FROM rememberme_token r WHERE r.email \= ? AND r.token \= ?":search-bind-dn=TestUser:search-bind-password=Password:directory=DummyDir:base-dn="DC\=company,DC\=com":file=testFile myRealm Command create-auth-realm executed successfully.
Samples
Context (Optional)
Running the post-boot-command file in a docker container
Environment
- Payara Version: 5.192
- Edition: Full
Description
When running a post-boot-command file, creating a auth-relam is not working properly. (in docker container)
I'm able to create some JDBC connection pools, registering some system properties, but creating a custom authentication-realm is not possible.
Expected Outcome
The commands are executed successfully, in these specific cases: authentication realm with sql statements as one or more properties properties.
It's also expected that the same command, tested with asadmin multimode, works in a postbootcommandfile, but it's not true.
Current Outcome
The log reports "This parameter may not have more than one value." when running using a post-boot-command file
`[2019-08-26T05:02:56.870+0000] [Payara 5.192] [SEVERE] [NCLS-CORE-00003] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1566795776870] [levelValue: 1000] [[
Exception while running a command
org.glassfish.common.util.admin.UnacceptableValueException: Invalid parameter: authrealmname. This parameter may not have more than one value.
at org.glassfish.common.util.admin.MapInjectionResolver.convertListToObject(MapInjectionResolver.java:405)
at org.glassfish.common.util.admin.MapInjectionResolver.getValue(MapInjectionResolver.java:136)
at org.jvnet.hk2.config.InjectionManager.syncDoInject(InjectionManager.java:170)
at org.jvnet.hk2.config.InjectionManager.inject(InjectionManager.java:74)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.injectParameters(CommandRunnerImpl.java:386)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1242)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:119)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1865)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1741)
at com.sun.enterprise.admin.cli.embeddable.CommandExecutorImpl.executeCommand(CommandExecutorImpl.java:172)
at com.sun.enterprise.admin.cli.embeddable.CommandExecutorImpl.run(CommandExecutorImpl.java:96)
at fish.payara.boot.runtime.BootCommand.execute(BootCommand.java:69)
at fish.payara.boot.runtime.BootCommands.executeCommands(BootCommands.java:110)
at fish.payara.boot.runtime.BootCommands.executeCommands(BootCommands.java:104)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.doBootCommands(GlassFishMain.java:294)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:133)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:109)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54)
]]
[2019-08-26T05:02:56.882+0000] [Payara 5.192] [WARNING] [] [fish.payara.boot.runtime.BootCommand] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1566795776882] [levelValue: 900] [[
Boot Command create-auth-realm failed PlainTextActionReporterFAILUREorg.glassfish.common.util.admin.UnacceptableValueException: Invalid parameter: authrealmname. This parameter may not have more than one value.Description: create-auth-realm commandInvalid parameter: authrealmname. This parameter may not have more than one value.
Usage: create-auth-realm --classname=classname [--property=property] [--target=server] [--login-module=login-module] authrealmname
]]
`
Steps to reproduce (Only for bug reports)
asAdmin command
Please note that in My case I do use a custom class. I chose here a 'FileRealm' to demonstrate my issue
create-auth-realm --classname=com.sun.enterprise.security.auth.realm.file.FileRealm --target=server-config --property java.naming.referral=ignore:jaas-context=myMontovaRealm:datasource.jndi=jdbc/SomeJDBC:sql.password="SELECT u.password FROM users u WHERE u.email \= ? AND u.active \= true":sql.groups="SELECT SOME OTHER SQL":sql.impersonate_user="YET ANOTHER":sql.token="SELECT r.token FROM rememberme_token r WHERE r.email \= ? AND r.token \= ?":search-bind-dn=TestUser:search-bind-password=Password:directory=DummyDir:base-dn="DC\=company,DC\=com":file=testFile myRealmWhen running this command in multimode
PS Desktop\payara-5.192\payara5\bin> .\asadmin create-auth-realm --classname=com.sun.enterprise.security.auth.realm.file.FileRealm --target=server-config --property java.naming.referral=ignore:jaas-context=myMontovaRealm:datasource.jndi=jdbc/SomeJDBC:sql.password="SELECT u.password FROM users u WHERE u.email \= ? AND u.active \= true":sql.groups="SELECT SOME OTHER SQL":sql.impersonate_user="YET ANOTHER":sql.token="SELECT r.token FROM rememberme_token r WHERE r.email \= ? AND r.token \= ?":search-bind-dn=TestUser:search-bind-password=Password:directory=DummyDir:base-dn="DC\=company,DC\=com":file=testFile myRealm Command create-auth-realm executed successfully.Samples
Context (Optional)
Running the post-boot-command file in a docker container
Environment