Please note, any code you write for user registration has to abide by the rules of your sites IRB and other site policies.
Create a service account in your SHRINE i2b2 PM. This account will only need the admin role. You can place these credentials in a config file. That way you can reference these credentials when you make the PM service calls in your code.
In these examples we use PHP, Feel free to use other programming languages to achieve the same tasks.