Creating a Microsoft Application is a pain in the assFor Microsoft auth use Litravan's Java OpenAuth repository on github.
Or you can create some kind of application on Microsoft (I don't know where exactly).
Then you just open a browser window to authorize through the application.