This page demonstrates how to configure the schemas to allow entities to set their own password and walks you through the create and invite Registry APIs using the example of a Student to set the password.
Configuring A Schema
We can create a schema in the registry using the and using JSON schema files as well
Here we are creating a Student schema, we would configure as following
This will store the entity in the registry, create the user account in IAM (keycloak) with given password for the Student and return the following object:
Here, registry-frontend is the pre-configured client we use to make requests to keycloak and pranav@1234 is the password for the Student entity, we created.
This API call should return a JSON object as follows:
http get \
'http://localhost:8081/api/v1/Student' \
'authorization: bearer {access-token}'
Replace the {id} above with the entity's osid you saved from the create entity request. Replace the {access-token} with the Student entity's access token from the consent/authentication step.
This will return the entity's JSON representation as follows:
Here password won't be returned. Password is used only in the creation of the Student entity in Keycloak and not stored directly in the database.
This will configure the entity to create a password while creating the entity object. Here ownership attribute password is required, Its value can be any path in the Student object we decide. If we don't set the password ownership attribute, It will take the default password .
We can create entities in the registry using the .
We can retrieve entities in the registry using the .