I have simple react native android application. I want to secure it using username and password basic authentication. Is it possible to authenticate using parse server? There seems to be no document on this part.
Look at the Android SDK instead. http://docs.parseplatform.org/android/guide/
This will show you how to create a user, login with that user, etc. If a mobile client is signed into your app, all cloud code function call requests will contain request.params.user
, which will be a "shell object" of a Parse.User. This means it just contains the class name and objectId, and you'd have to "fetch" the object in order to get the rest of the data.
But, it's existence means that a session key was automatically passed into the function call by the client. If you aren't signed in, request.params.user
is undefined. So, you could rely on one of two things: Signing in gets you to the rest of your app, then you don't even worry about checking request.params.user
because you assume anyone who got that far was signed in. This is the easier but lazier approach.
Or you can validate request.params.user
to ensure whoever is making the function call is allowed to.
request.params.user
is also very helpful in locking down security of your data with ACLs and CLPs, ensuring that only users who have permissions to do certain operations, like saving, deleting, finding, and fetching objects, do so. You have to explicitly pass their session key into those Parse operations, or else it treats the request as coming from anyone.