Hi List,
I found the cure. The REST request url needs a trailing / after the username -
like this;
curl -H 'Content-Type: application/json' -X POST
[http://admin:geoserver@localhost:8080/geoserver/rest/security/usergroup/user/test%40test.com/](http://admin:geoserver@localhost:9090/geoserver/rest/security/usergroup/user/test%40test.com/)
-d '{"org.geoserver.rest.security.xml.JaxbUser":{"userName":
"t...@test.com","password": "test123","enabled": false}}'
Thanks
Gus
------- Original Message -------
On Tuesday, April 5th, 2022 at 12:15 PM, Gus MacAulay <g...@thuser.com.au>
wrote:
> Hi List,
>
> I'm trying to use the REST API to enable/disable users, but running into an
> issue when the username contains punctuation like @ or . (if the username is
> an email for example).
>
> If I create a user 't...@test.com' and do this:
>
> curl -H 'Content-Type: application/json' -X POST
> [http://admin:geoserver@localhost:9090/geoserver/rest/security/usergroup/user/test%40test..com](http://admin:geoserver@localhost:9090/geoserver/rest/security/usergroup/user/)
> -d '{"org.geoserver.rest.security.xml.JaxbUser":{"userName":
> "t...@test.com","password": "test123","enabled": false}}'
>
> I get this:
>
> URI:/geoserver/rest/security/usergroup/user/test%40test..com
> STATUS:404
> MESSAGE:Provided username does not exist: test@test.
> SERVLET:dispatcher
>
> You can see I already did some experimenting with the url to encode/escpae
> the '@' with '%40' and the '.' with a second '.' - but I can't figure a way
> to make it recognise the whole username. Is there a workaround or is this a
> bug?
>
> Thanks
> Gus
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before posting to this
list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
If you want to request a feature or an improvement, also see this:
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users