Search code examples
wordpressauthenticationparse-platformpfuser

How to Create a Parse.com Login Form in Wordpress Website?


I'm Developing a Parse iOS app and i would like to have a Website Version !

In My iOS app i can Register PFUsers. I would like to do the same for my Website but i don't know how to link Parse Login Form with my Wordpress Website.

Does Anyone know how to it ?


Solution

  • You use the Parse JS SDK, which should be able to mostly use the same cloud code.

    So on your website, you need to include your Parse keys: https://parse.com/apps/quickstart#parse_data/web/existing

    Note that these keys are exposed to the public, which is usually fine, but make sure you set all your ACLs properly so that all the data is safe.

    After that, logging in is simple: https://parse.com/docs/js/guide#users-logging-in

    So basically, in a JS file:

        Parse.User.logIn("myname", "mypass", 
           success: function(user) {
             // Do stuff after successful login.
           },
           error: function(user, error) {
             // The login failed. Check error to see why.
           }
         });
    

    where "myname" and "mypass" are the user login credentials that you grab from an html form or inputs.

    However, I highly recommend writing your own login function in cloud code so that you can perform your own validation before passing it along to the Parse login. Also as an aside, Parse uses SSL so this data should never be able to be sent in clear text while communicating using Parse.