Provision UNS Account
4 min
provision a uns mqtt account ui trigger luns > security > create account > add permissions creates an mqtt account on the litmusuns broker, sets its acl rules (which topic paths it can subscribe/publish to), and enables it all luns calls are graphql posts to a single endpoint the operation is selected by the graphql query/mutation, not by url url pattern every step is post {{uns url}}/mqtt/gql with header authorization bearer \<uns token> the token is obtained once per session via the luns oauth2 password grant at {{uns url}}/auth/realms/standalone/protocol/openid connect/token step table step name in collection graphql operation input output / what to capture 1 (optional) get accounts query account { account { } } existing accounts avoid name collision 2 create account mutation createaccount { username, password, actype "general", enabled false } account id (uuid) 3 add account rules mutation addaccountrules { accountid \<from step 2>, rules \[{ path "\<topic path>", perm "sub" | "pub" | "pubsub" }] } rules attached 4 enable account mutation enableaccount { accountid \<from step 2> } account active 5 (verify) account details query account(id ) account id final state with rules + connected clients variants for binding a litmus edge to uns replace step 2 with create litmusedge activation token (mutation that returns a token the le uses during enrollment) steps 3 5 then operate on the auto created account once the le connects cleanup disable account , remove account rules , remove account , or reset account password all share the same endpoint with their respective mutations all luns endpoints every luns operation (dashboard, uns, security, mqtt, integrations, tools 28 total) targets the same /mqtt/gql url section grouping is purely organizational the operation is in the graphql body see also litmus uns product overview # security reference #