-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot add a user to a authentication source of a realm #20
Comments
Hi @Jopie01 you are correct. The issue is that not all Admin WAMP Procedures are exposed via the Admin HTTP API right now. Just to check, for a user in your realm to be able to authenticate using a particular methods you need:
We are currently working on implementing and documenting all the HTTP API (I added Issue #21 to track this activity ). In the meantime, you can operate on your Realm's sources using the WAMP API, please check the docs for You could use Wick as you use CURL to call that procedure 😄 . For example to allow ./wick --url ws://localhost:18081/ws \
--realm com.leapsight.bondy \
call bondy.source.add \
"com.myrealm" \
'{
"usernames":["myusername"],
"authmethod":"password",
"cidr":"0.0.0.0/0"
}' | jq |
@Jopie01 there is another option via HTTP. You can use the (undocumented) curl -X "POST" "http://localhost:18081/services/call" \
-H 'Content-Type: application/json; charset=utf-8' \
-H 'Accept: application/json; charset=utf-8' \
-d $'{
"procedure": "bondy.source.add",
"arguments": [
"com.myrealm",
{
"usernames":["myusername"],
"authmethod":"password",
"cidr":"0.0.0.0/0"
}
],
"options": {},
"arguments_kw": {}
}' |
@aramallo Thanks for the answer. I have already a running instance of Bondy with two users, but these are configured in the When I execute curl -X "POST" "http://localhost:18081/services/call" \
-H 'Content-Type: application/json; charset=utf-8' \
-H 'Accept: application/json; charset=utf-8' \
-d $'{
"procedure": "bondy.source.add",
"arguments": [
"com.example.realm",
{
"usernames":["client1", "client2", "client3"],
"authmethod":"cryptosign",
"cidr":"0.0.0.0/0"
}
],
"options": {},
"arguments_kw": {}
}' I get this error back:
Just to mention that I want to add "client3" as the new user. The other two users are already there. I don't know if it is enough to only send the new user and that Bondy will take care to add the new user to the already existing list of usernames. |
Arggg. Sorry @Jopie01 my bad, I was using an old snippet. Can you try with the following? curl -X "POST" "http://localhost:18081/services/call" \
-H 'Content-Type: application/json; charset=utf-8' \
-H 'Accept: application/json; charset=utf-8' \
-d $'{
"procedure": "bondy.source.add",
"options": {},
"args": [
"com.example.realm",
{
"usernames":["client1", "client2", "client3"],
"authmethod":"cryptosign",
"cidr":"0.0.0.0/0"
}
],
"kwargs": {}
}'
|
Re your question
Yes, you could just send the request with |
@aramallo, thanks for the answers. Everything now works perfectly! Also the Wick one works. |
Background: I want to add a new user through the http-api on port 18081. I'm using Postman for that (local install).
I'm able to add a user to a realm with a password or cryptosign key and add it to a group. But when I try to login I always get the message
Looking at my default
security_config.json
I find a section calledsources
where the different authentication methods are defined and usernames linked to an authentication method. For cryptosign, I have to add the new user to the list of usernames. I cannot getsources
through the api and I don't know add the new user. Also it's nowhere in the documentation and not specified in https://github.com/bondy-io/bondy/blob/develop/apps/bondy/priv/specs/bondy_admin_api.jsonSo the question is, how can this be done in a running Bondy instance?
The text was updated successfully, but these errors were encountered: