I have attached a user to an Endpoint using KaaClient.attachUser() methond(using trustful verifier), and I received a success status message back from server. But, where do I see this user in Admin UI? Moreover, If I try to use the the userID and try to push a configuration update to endpoint, I receive item not found error on Admin UI.
1 Answers
Currently there is no such feature that would allow to list all the attached users. Updating configuration values of configuration schema for a user (using userID) via Admin UI is possible only after that user has been attached in a client app at lease one time:
KaaClient.attachUser(userId, ...)
To use custom user configuration schema with different values for different attached users try to follow the instructions below:
Add a configuration schema for needed demo application (in this guide we will use Event Demo):
- Login to Administration UI as a tenant developer
- Go to Applications -> Event Demo -> Schemas -> Configuration. Click Add Schema button
- On the "Add configuration schema" page click Create new type button
- Fill all required fields: Name (e.g. EventUserSchema), Namespace (e.g. org.kaa.kaaproject.demo.schema), Display name (Event User Schema) etc.
- Add all needed fields to the schema (e.g. fields "userKey" and "userValue" with "String" type and field "count" with "Integer" type and default value "42"): on the same page for each field click Add button in the "Fields" area, fill all required data included Field name and Field type and click Add button.
- After all fields are added on the top of the page click Add button. If you do everything right new configuration schema with version "2" and name "Event User Schema" will be listed on the page. If you export it and open with a file reader you will see something like this:
{ "type": "record", "name": "EventUserSchema", "namespace": "org.kaa.kaaproject.demo.schema", "fields": [ { "name": "userKey", "type": [ { "type": "string", "avro.java.string": "String" }, "null" ], "displayName": "", "displayPrompt": "" }, { "name": "userValue", "type": [ { "type": "string", "avro.java.string": "String" }, "null" ] }, { "name": "count", "type": "int", "by_default": 42 } ], "version": 1, "dependencies": [], "displayName": "Event User Schema", "description": "" }
Add SDK profile with newly created configuration schema:
- Go to Applications -> Event Demo -> SDK profiles. Click Add SDK profile button.
- Enter Name (e.g. EventUserSDK), select Configuration schema version (for this case the version should be set to 2), add needed Event class families (for Event Demo we need Chan Event Class Family), select Trustful verifier.
- On the same page click Add SDK profile button.
- If everything is ok SDK profile with name "EventUserSDK" and Configuration "v2" will be listed on SDK profiles page.
- On the same page click Generate SDK button for newly created SDK, select needed language and click Generate SDK button to download new SDK.
Replace SDK library from your client application with new downloaded SDK, rebuild your app. After that you will be able to use configuration values, related to the defined configuration schema, in the application:
kaaClient.getConfiguration().getCount();
kaaClient.getConfiguration().getUserKey();
kaaClient.getConfiguration().getUserValue();
These values can be used after KaaClient.attachUser(...) place in code.
After running the app. If the user is attached successfully and you receive something like Attach response: SUCCESS, the configuration values will be set to default ones (default values are described in the configuration schema) and you will able to change them for each userID on the appropriate admin page:
- Go to Applications > Event Demo -> Users > Update configuration.
- Enter userID that has been already attached to KaaClient.
- Select configuration schema version and fill all values for configuration body area.
- Click Update configuration button. The configuration values will be changed for all endpoints which use the entered userID.
It is also possible to setup configuration schemes and values via REST. Please see Server REST APIs documentation page .

- 360
- 1
- 3
- 16
-
Thanks a lot for the reply. That answers my question. – sr33kanth Apr 20 '17 at 08:19