Reputation: 1
We are trying to use the OpenAM REST API to manage and authenticate the users of a Web application. For now we successfully authenticate and identify our users by chaining calls to authenticate, isValidToken and attributes URLs.
But we are having difficulties using self-registration with _/users/?action=register. We fail to specify the realm into which the user should be created. We tried a query parameter, a data parameter, inserting the realm in the URL, etc. But no success yet, I guess we are missing something from the documentation.
Basically we want to know how to specify the realm in this curl command:
curl http://MYHOST.fr/openam/json/users/?_action=register --request POST --header
"Content-Type: application/json" --data '{"email": "[email protected]","subject":
"Confirmez votre inscription", "message": "Suivez ce lien pour confirmer votre
inscription : "}';
Could someone give us a pointer ?
Thanks
( you can see http://openam.forgerock.org/openam-documentation/openam-doc-source/doc/dev-guide/#rest-api-self-registration for more details about self-registration with openAM RST API )
Upvotes: 0
Views: 2377
Reputation: 2744
First of all I should tell you that it's not a good idea to use OpenAM APIs (REST,SOAP,SDK) for Identity Manager or provisioning (as this is what you're doing).
OpenAM is NOT the master of identity information, it only consumes identity information from configured data stores to build a virtual identity in memory.
And there you go ... think of having multiple data store ...
Furthermore you have VERY few control how and where the identities are created.
Use the API of the data store to create identities or some identity management tools like OpenIdM.
If your data store is OpenDJ then it offers a REST api as well in recent versions. Although when using Directory Servers, LDAP is the way to go.
However if you really want to use OpenAM APIs for IdM , have you tried
url http://MYHOST.fr/openam/json/somerealm/users/?_action=register --request POST --header "Content-Type: application/json" --data '{"email": "[email protected]","subject": "Confirmez votre inscription", "message": "Suivez ce lien pour confirmer votre inscription : "}';
Upvotes: 1