Thread:Project:Support desk/Externally create users and login to my wiki (2)/reply

You might first want to check to see if there is an extension which already does the precise thing you want: Extension_Matrix/user_identity. If not, the API documentation should help you get started on coming up with a solution using the API.