[Java] How do you submit a command to create or exercise a choice with user management
- jaypeedaOP
Hi team,
How do you submit a command in Java using the User management?
Thanks and regards,
Jean-Paul - stefanobaghino-da 2
As of 2.4.0, all Java bindings methods have an overload that allows to pass in an access token. If the access token comes in the format expected for user tokens instead of custom claim tokens, the claims for the user will be read from the ones existing for the user as recorded through the
UserManagementService. - jaypeeda
Amazing, thanks @stefanobaghino-da !
This means that there is no other way in 2.4.0 to submit as the user besides JWT ?
- stefanobaghino-da 1
No, the access token is how you authorize calls. Were you after something else in particular?
- cocreature 1
Just to make this explicit: Passing the access token does not remove the need to specify the actAs/readAs parties. You always need to specify those explicitly. User management only allows you to use a token for a user and the ledger will then validate that the parties you specified are within the rights associated with your user.
- jaypeeda
I just wanted to explore the different options and know if there is a Daml script equivalent of the
submitUserand use directly the classUser.@cocreature, noted with thanks !
- jaypeeda
Would you please have a code example @cocreature ?
- cocreature
For what exactly? There is nothing special about a submission using user management from the Java bindings side. You still have to specify parties. quickstart-java contains a command submission if that’s what you’re looking for daml/IouMain.java at 58727f55801f14649ecb83e367708aaaf2b89b6a · digital-asset/daml · GitHub
- jaypeeda
Thanks