Skip to content

Instantly share code, notes, and snippets.

@bjwschaap
Created January 6, 2016 15:44
Show Gist options
  • Save bjwschaap/dab739fef4edb27daa63 to your computer and use it in GitHub Desktop.
Save bjwschaap/dab739fef4edb27daa63 to your computer and use it in GitHub Desktop.
Wildfly http management API weirdness..
## Digest, as per documentation, no joy..
/# curl -v --digest -u dbxbsc http://localhost:9990/management/ -d '{"operation":"connection-info" }' -HContent-Type:application/json
Enter host password for user 'dbxbsc':
* About to connect() to localhost port 9990 (#0)
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 9990 (#0)
* Server auth using Digest with user 'dbxbsc'
> POST /management/ HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.6.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:9990
> Accept: */*
> Content-Type:application/json
> Content-Length: 0
>
< HTTP/1.1 401 Unauthorized
< Connection: keep-alive
< WWW-Authenticate: Basic realm="KvKLDAPRealm"
< Content-Length: 77
< Content-Type: text/html
< Date: Wed, 06 Jan 2016 13:36:30 GMT
<
* Connection #0 to host localhost left intact
* Closing connection #0
<html><head><title>Error</title></head><body>401 - Unauthorized</body></html>
## Just to check credentials..
/# jboss-cli.sh -c
Username: dbxbsc
Password:
[standalone@localhost:9990 /] connection-info
Username dbxbsc, granted role ["SuperUser"]
Logged since Wed Jan 06 13:36:42 UTC 2016
Not an SSL connection.
[standalone@localhost:9990 /] exit
## No Digest but Basic works?!..
/# curl -v -u dbxbsc http://localhost:9990/management/core-service=management -d '{"operation":"read-resource" }' -HContent-Type:application/json
Enter host password for user 'dbxbsc':
* About to connect() to localhost port 9990 (#0)
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 9990 (#0)
* Server auth using Basic with user 'dbxbsc'
> POST /management/core-service=management HTTP/1.1
> Authorization: Basic ZGJ4YnNjOkQzcGwweW0zbnRzMTM=
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.6.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:9990
> Accept: */*
> Content-Type:application/json
> Content-Length: 30
>
< HTTP/1.1 200 OK
< Connection: keep-alive
< Content-Type: application/json; charset=utf-8
< Content-Length: 2674
< Date: Wed, 06 Jan 2016 13:41:33 GMT
<
{"outcome" : "success", "result" : {"management-major-version" : 3, "management-micro-version" : 0, "management-minor-version" : 0, "name" : "wildfly1", "namespaces" : [], "product-name" : "WildFly Full", "product-version" : "9.0.2.Final", "profile-name" : null, "release-codename" : "Kenny", "release-version" : "1.0.2.Final", "schema-locations" : [], "core-service" : {"service-container" : null, "server-environment" : null, "module-loading" : null, "platform-mbean" : null, "management" : null, "patching" : null}, "deployment" : {"wmq.jmsra.rar" : null}, "deployment-overlay" : null, "extension" : {"org.jboss.as.clustering.infinispan" : null, "org.jboss.as.connector" : null, "org.jboss.as.deployment-scanner" : null, "org.jboss.as.ee" : null, "org.jboss.as.ejb3" : null, "org.jboss.as.jaxrs" : null, "org.jboss.as.jdr" : null, "org.jboss.as.jmx" : null, "org.jboss.as.jpa" : null, "org.jboss.as.jsf" : null, "org.jboss.as.jsr77" : null, "org.jboss.as.logging" : null, "org.jboss.as.mail" : null, "org.jboss.as.messaging" : null, "org.jboss.as.naming" : null, "org.jboss.as.pojo" : null, "org.jboss.as.remoting" : null, "org.jboss.as.sar" : null, "org.jboss.as.security" : null, "org.jboss.as.transactions" : null, "org.jboss.as.webservices" : null, "org.jboss.as.weld" : null, "org.wildfly.extension.batch" : null, "org.wildfly.extension.bean-validation" : null, "org.wildfly.extension.io" : null, "org.wildfly.extension.request-controller" : null, "org.wildfly.extension.security.manager" : null, "org.wildfly.extension.undertow" : null, "org.wildfly.iiop-openjdk" : null}, "interface" : {"management" : null, "public" : null, "unsecure" : null}, "path" : {"jboss.server.temp.dir" : null, "user.home" : null, "jboss.server.base.dir" : null, "java.home" : null, "user.dir" : null, "jboss.server.data.dir" : null, "jboss.home.dir" : null, "jboss.server.log.dir" : null, "jboss.server.config.dir" : null, "jboss.controller.temp.dir" : null}, "socket-binding-group" : {"standard-sockets" : null}, "subsystem" : {"jaxrs" : null, "io" : null, "security-manager" : null, "jsf" : null, "jca" : null, "jmx" : null, "bean-validation" : null, "iiop-openjdk" : null, "request-controller" : null, "webservices" : null, "sar" : null, "batch" : null, "remoting" : null, "infinispan" : null, "weld" : null, "ejb3" : null, "transactions" : null, "datasources" : null, "deployment-scanner" : null, "logging" : null, "jdr" : null, "undertow" : null, "messaging" : null, "pojo" : null, "jpa" : null, "naming" : null, "ee" : null, "mail" : null, "jsr77" : null, "resource-adapters" : null, "security" : null}, "system-property" : {"com.ibm.msg.client.commonservices.log.status" : null}}}
* Connection #0 to host localhost left intact
* Closing connection #0
@BobVanB
Copy link

BobVanB commented Oct 14, 2016

@bjwschaap Jooo :D
Heb jij ergens dit probleem gepost?
Ik loop er namelijk nu ook tegen aan, moet zeggen dat wildfly authenticatie erg frustrerend begint te worden 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment