Closed dkastl closed 1 year ago
usersCreate003 error 400 Bad Request {"error":{"message":"Invalid email","code":400,"title":"Bad Request"}}
This error is a respose from your Keyrock instance. The error message of NGSI Go has a prefix like usersCreate003
. A prefix consists of a Go lang function name and a position in the funciton. In this case, the function name is usersCreate
. The position is 3rd. See here .
Could you try replacing exmaple.com
with your domain?
ubuntu@fi-bb:~$ ngsi users create --host keyrock.letsfiware.jp --username user001 --email user001@example.com --password 1234
usersCreate003 error 400 Bad Request {"error":{"message":"Invalid email","code":400,"title":"Bad Request"}}
ubuntu@fi-bb:~$ ngsi users create --host keyrock.letsfiware.jp --username user001 --email user001@letsfiware.jp --password 1234
368401c5-49d6-4624-90ee-e66d0a73d8b3
ubuntu@fi-bb:~$ ngsi users list
368401c5-49d6-4624-90ee-e66d0a73d8b3
admin
If you want to add a user with the example.com
domain, add exmaple.com
to config/keyrock/whitelist.txt
and restart your Keyrock instance. The FIWARE Big bang sets up a Keyrock instance with whitelist
as the email list type. See here.
ubuntu@fi-bb:~$ cat config/keyrock/whitelist.txt
letsfiware.jp
example.com
ubuntu@fi-bb:~$ ngsi users create --username user001 --email user001@example.com --password 1234 --host keyrock.letsfiware.jp
4201c1fd-52d3-4bd7-abfd-94319266549e
ubuntu@fi-bb:~$ ngsi users get --uid 4201c1fd-52d3-4bd7-abfd-94319266549e -P
{
"user": {
"scope": [],
"id": "4201c1fd-52d3-4bd7-abfd-94319266549e",
"username": "user001",
"email": "user001@example.com",
"enabled": true,
"admin": false,
"image": "default",
"gravatar": false,
"date_password": "2023-01-27T07:50:05.000Z",
"description": null,
"website": null
}
}
Thanks a lot!
This indeed works with an email address using the same (sub-) domain that was used for the setup.
To mention whitelist.txt
in this context in the documentation is a good idea. It seems the whitelist does not apply when adding users through the UI. Not sure this is a bug or a feature ;-)
But it may affect self-registration, which also didn't work. Will need to try again.
Normally, Keyrock should be setup with Mail Transfer Agent. After registing a new user on UI of Keyrock, a user will receive an email to active an account from Keyrock. Before doing that, a use can not log in keyrock. Probably, when a domain of an email does not found in a whitelist, Keyrock will not send a use to an email. But this topic is not about FIWARE Bing Bang. Please read Keyrock documentation or source code.
Merged PR #237
Checklist
make collect
command.Describe the bug
I'm trying to create a user as described in https://fi-bb.letsfiware.jp/examples/keyrock/ , which returns an error:
However, the following works:
So the only command that does not work is
create
and the email address doesn't appear to be wrong.Your system environment
To Reproduce Steps to reproduce the behavior:
Expected behavior
A new user is created.
Server (please complete the following information):
Additional context
There was no log output in
/var/log/fiware/keyrock.log
when making the request.