PHPackages                             thisanimus/craft-ccb-login - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. thisanimus/craft-ccb-login

ActiveCraft-plugin[Authentication &amp; Authorization](/categories/authentication)

thisanimus/craft-ccb-login
==========================

Log in via the CCB API, and log user info in session.

2.0.7(2y ago)0297MITPHP

Since May 21Pushed 2y ago2 watchersCompare

[ Source](https://github.com/thisanimus/craft-ccb-login)[ Packagist](https://packagist.org/packages/thisanimus/craft-ccb-login)[ RSS](/packages/thisanimus-craft-ccb-login/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (10)Dependencies (2)Versions (13)Used By (0)

CCB API Authentication for Craft CMS 4.x/5.x
============================================

[](#ccb-api-authentication-for-craft-cms-4x5x)

A session-based login for Craft CMS 4.x/5.x that authenticates users via the Church Community Builder API.

[![Screenshot](src/icon.svg)](src/icon.svg)

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 4 or later.

Installation
------------

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
    cd /path/to/project

    ```
2. Then tell Composer to load the plugin:

    ```
    composer require thisanimus/craft-ccb-login

    ```
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for craft-ccb-login.

Configuration
-------------

[](#configuration)

In the Craft Control Panel, enter your CCB API User Credentials. These will be used to make the necessary API requests.

Overview
--------

[](#overview)

- User submits a username and password through a form on the front end of your site.
- The plugin passes those creds to the "individual\_profile\_from\_login\_password" service of the [CCB API](https://designccb.s3.amazonaws.com/helpdesk/files/official_docs/api.html).
- If the user exists in CCB, the plugin then fetches the user's profile, and the IDs of the groups this person is a part of.
- The plugin sets the authentication status and the user information as session variables.

#### Successful Login

[](#successful-login)

```
$_SESSION = [
	'ccb_authenticated':true,
	'ccb_individual'=>[/* The whole CCB Individual Response */],
	'ccb_groups'=>[1,5,34,388]
];
```

#### Unsuccessful Login

[](#unsuccessful-login)

```
$_SESSION = [
	'ccb_authenticated':false,
	'ccb_error'=>'Whatever error the CCB API throws'
];
```

#### Session Vars

[](#session-vars)

Access the session vars in your template using the included plugin twig var:

```
{{ dump(craft.ccblogin.userSession) }}
```

This gives you access to a user's authentication status, profile info, and group memberships. You can use these as conditions when determining what gets rendered in the twig template.

Twig Templates
--------------

[](#twig-templates)

Here are some templates to get you started:

#### Login

[](#login)

```

	{{ csrfInput() }}

	Username

	Password

Forgot Password?
Sign Up
```

#### Logout

[](#logout)

```

	{{ csrfInput() }}

```

#### Conditional Markup with CCB Login Sync

[](#conditional-markup-with-ccb-login-sync)

```
{% set session = craft.ccblogin.userSession %}

{% if session.ccb_authenticated == false %}
	{% if session.error is defined %}

			{{ session.error }}

	{% endif %}

		{{ csrfInput() }}

		Username

		Password

		Log me in to Community.

			This will open a new tab and log you in to Church Community Builder at the same time you are being logged into this website.

	{% if session.ccb_error is defined %}

			{{ session.ccb_error }}

	{% endif %}

	Forgot Password?
	Sign Up

{% elseif session.ccb_authenticated == true %}

	{{ session.ccb_individual.full_name }}
	{% if session.ccb_groups|length > 0 %}
		Group IDs:

			{% for group in session.ccb_groups %}
				{{ group }}
			{% endfor %}

	{% endif %}

		{{ csrfInput() }}

{% endif %}

{% js at endBody %}

// get the forms
const craftLogin = document.getElementById('craftLogin');
const cbbLogin = document.getElementById('ccbLogin');
var time = 0;

// on craft form submit, prevent the default behavior
craftLogin.addEventListener('submit', function(e){
	e.preventDefault();

	// get login input values from the craft form
	let login = craftLogin.querySelector('input[name="formLogin"]').value;
	let password = craftLogin.querySelector('input[name="formPassword"]').value;

	if(craftLogin.querySelector('input[name="formCCB"]').checked == true){
		// give a little bit of time for the ccb form submission
		var time = 1000;
		ccbLogin.querySelector('input[name="form[login]"]').value = login;
		ccbLogin.querySelector('input[name="form[password]"]').value = password;
		ccbLogin.submit();
	}
	setTimeout(function(){
		craftLogin.submit();
	}, time);

});

{% endjs %}
```

Credits
-------

[](#credits)

Praise and rotten tomatoes alike may be lobbed at [Andrew Hale](https://thisanimus.com).

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 80.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~164 days

Recently: every ~75 days

Total

12

Last Release

789d ago

Major Versions

1.0.9 → 2.0.02022-05-06

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6612542?v=4)[Andrew Hale](/maintainers/thisanimus)[@thisanimus](https://github.com/thisanimus)

---

Top Contributors

[![thisanimus](https://avatars.githubusercontent.com/u/6612542?v=4)](https://github.com/thisanimus "thisanimus (37 commits)")[![cbcsouthlake](https://avatars.githubusercontent.com/u/31710075?v=4)](https://github.com/cbcsouthlake "cbcsouthlake (9 commits)")

---

Tags

cmsCraftcraftcmscraft-pluginccb-login

### Embed Badge

![Health badge](/badges/thisanimus-craft-ccb-login/health.svg)

```
[![Health](https://phpackages.com/badges/thisanimus-craft-ccb-login/health.svg)](https://phpackages.com/packages/thisanimus-craft-ccb-login)
```

###  Alternatives

[verbb/hyper

A user-friendly links field for Craft.

24142.6k12](/packages/verbb-hyper)[verbb/social-poster

Automatically post entries to social media.

918.5k](/packages/verbb-social-poster)[jamesedmonston/graphql-authentication

GraphQL authentication for your headless Craft CMS applications.

2917.3k](/packages/jamesedmonston-graphql-authentication)[saccilottoconsulting/craft-internal-assets

A simple plugin to restrict access to assets for permitted users only. Access to a given asset is only granted if the user has view-permissions for the given source (this can be set in the user- or group-settings). The asset source folder should be moved out of the web root folder so the files are never accessible without this plugin.

353.5k](/packages/saccilottoconsulting-craft-internal-assets)[tomdiggle/craft-gatekeeper

Protect your Craft CMS website from access with a universal password.

109.3k](/packages/tomdiggle-craft-gatekeeper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
