[keycloak-user] Problems with kcadm returning messages as errors incorrectly

Leigh Kennedy Leigh.Kennedy at qlik.com
Wed May 8 03:10:16 EDT 2019


Hi,

I have been porting some keycloak scripts I wrote from linux to powershell.

The issue I have is while the commands work, the output is being returned as stderr incorrectly.  i.e :

PS C:\Windows\system32> kcadm.bat config credentials --server http://127.0.0.1:8080/auth --realm master --user myuser --password xxxx
kcadm.bat : Logging into http://127.0.0.1:8080/auth as user myuser of realm master

At line:1 char:1
+ kcadm.bat config credentials --server http://127.0.0.1:8080/auth --re ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Logging into ht...of realm master:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError


If I redirect the error ourput to a file, I get no output:

PS C:\Windows\system32> kcadm.bat config credentials --server http://127.0.0.1:8080/auth --realm master --user qlik --password Qlik1234  2>console.err

PS C:\Windows\system32>

The commands are working, but for some reason the way the java returns the output is causing the issue.

Does anyone know how to work around this?

Thanks.

Leigh.


More information about the keycloak-user mailing list