How can I authenticate as an Realm user through a Java desktop application?

Hi, I just set up authentication in my android app, but I want to implement something similar with my desktop version of the same app, so I can authenticate users before interacting with the cluster and such.

How can I do this in desktop? Data API? I’m getting really lost and I’d like authentication to be just like in Realm, otherwise integration between desktop and android is impossible.

Anyone can offer some advice?