Simplified Login Page Using CCB API – Part II

Welcome to another CCB Tutorial.

Picking up from where we left off last, it was brought to my attention that last week’s tutorial may have another option as it pertains to creating a simplified login page using the CCB API.

Last week’s tutorial focused on validating a user’s credentials simply using the Individual Profile from Login and Password CCB API service.

Again, last week’s tutorial and today’s tutorial are not a secure or fool-proof login system, and should not be depicted or interpreted as such.

In addition to using the Individual Profile from Login and Password CCB API service, I would like to introduce you to another CCB API service that can be interchanged as well: Community Login.

The Community Login service will return the individual ID for an individual in the Church Community Builder system using the username and password assigned for the individual as parameters for the POST request.

Copying and pasting code from the previous tutorial, create, name and save the following PHP file: ccb-login-id.php.

Now that ccb-login-id.php exists, a few modifications are needed to use the Community Login service:

  • Change apiService variable to be individual_id_from_login_password
  • Change the xpath expression from //individuals/individual to //items/item

Once modifications are made, it’s time to test the Community Login service.

Your login page should function as the previous tutorial did with the exception of using the individual_id_from_login_password API service instead of the individual_profile_from_login_password API service.

That’s it! You now have two methods for verifying a users credentials. Please do let me know if you have questions or comments concerning this tutorial.

Thanks and that’s all for now! 🙂


Please comment if this tutorial has helped you.