All Projects → vanilla → jsConnectPHP

vanilla / jsConnectPHP

Licence: MIT License
Contains client files for Vanilla's jsConnect with a PHP project.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to jsConnectPHP

QrF.Core
基于.net core 2.2 的微服务框架
Stars: ✭ 19 (-50%)
Mutual labels:  sso
security-wrapper
对springSecurity进行二次开发,提供OAuth2授权(支持跨域名,多应用授权)、JWT、SSO、文件上传、权限系统无障碍接入、接口防刷、XSS、CSRF、SQL注入、三方登录(绑定,解绑)、加密通信等一系列安全场景的解决方案
Stars: ✭ 21 (-44.74%)
Mutual labels:  sso
OpenAM
OpenAM is an open access management solution that includes Authentication, SSO, Authorization, Federation, Entitlements and Web Services Security.
Stars: ✭ 476 (+1152.63%)
Mutual labels:  sso
wordpress-vanilla
Official WordPress plugin for Vanilla Forums integration.
Stars: ✭ 18 (-52.63%)
Mutual labels:  sso
workos-node
Official Node SDK for interacting with the WorkOS API
Stars: ✭ 42 (+10.53%)
Mutual labels:  sso
traefik-proxy
One-step (secure) configuration for Traefik edge router.
Stars: ✭ 20 (-47.37%)
Mutual labels:  sso
wp-simple-saml
WordPress Simple SAML plugin
Stars: ✭ 73 (+92.11%)
Mutual labels:  sso
lsso
Nginx SSO middleware for protecting your internets.
Stars: ✭ 42 (+10.53%)
Mutual labels:  sso
jeesuite-passport
Jeesuite-passport是面向企业级单点登录、统一认证的一站式解决方案。支持微信、企业微信、主流开放平台OAuth、Oauth2.0,JWT、SAML2.0多种认证集成模式。
Stars: ✭ 108 (+184.21%)
Mutual labels:  sso
Yuna
Yuan企业通用后台,快速实现微后台架构
Stars: ✭ 19 (-50%)
Mutual labels:  sso
django-federated-login
Django Federated Login provides an authentication bridge between Django projects and OpenID-enabled identity providers.
Stars: ✭ 18 (-52.63%)
Mutual labels:  sso
keycloak-sso-configs
common keycloak single sign on configurations
Stars: ✭ 19 (-50%)
Mutual labels:  sso
keycloak-session-restrictor
Simple event-listener for Keycloak which restricts the current user sessions to one (last one wins) only. Demo purposes only!
Stars: ✭ 48 (+26.32%)
Mutual labels:  sso
shib-cas-authn3
Integrates an external CAS Server and Shibboleth IdPv3.
Stars: ✭ 21 (-44.74%)
Mutual labels:  sso
active-directory-integration2
WordPress plug-in "Next Active Directory Integration"
Stars: ✭ 51 (+34.21%)
Mutual labels:  sso
sso-examples
Single Sign-On (SSO) examples for Metabase integration
Stars: ✭ 39 (+2.63%)
Mutual labels:  sso
sparcssso
Single Sign On System for SPARCS
Stars: ✭ 15 (-60.53%)
Mutual labels:  sso
dolphin
Automated code tool for Golang
Stars: ✭ 27 (-28.95%)
Mutual labels:  sso
saml-service-provider
SAML Service Provider (SSO)
Stars: ✭ 13 (-65.79%)
Mutual labels:  sso
flarum-ext-sso
🔒 Single Sign On for Flarum.
Stars: ✭ 59 (+55.26%)
Mutual labels:  sso

Vanilla jsConnect Client Library for PHP

Note: Vanilla has recently updated it's jsConnect protocol to a different architecture that will work with current browsers that block third party cookies. Make sure you update your libraries to use the protocol. Once you've done this you will need to configure Vanilla to use the protocol in your dashboard under jsConnect settings.

About jsConnect

The jsConnect protocol is a simple single sign on (SSO) framework that allows you to easily use your own site to sign on to a Vanilla site. It is intended to require as little programming as possible. You will need to do the following:

  1. Program one page that responds with information about the currently signed in user.
  2. Your main sign in page should be capable of redirecting to a URL that is supplied in the querystring.
  3. You can optionally provide a registration page too, but it must also be capable of redirecting via a query string parameter.

Installation

There are two ways to install jsConnect.

  1. You can install this library via composer. You want to require vanilla/js-connect-php.
  2. You can use the supplied functions.jsconnect.php. This is the old way of installing Vanilla. It still works, but we recommend transitioning to the composer install.

Usage

There are two ways to use this jsConnect library. There is an object oriented way and a functional way.

Object Oriented Usage

If you are new to jsConnect then we recommend the object oriented usage. Here is an example of what your page might look like.

$jsConnect = new \Vanilla\JsConnect\JsConnect();

// 1. Add your client ID and secret. These values are defined in your dashboard.
$jsConnect->setSigningCredentials($clientID, $secret);

// 2. Grab the current user from your session management system or database here.
$signedIn = true; // this is just a placeholder

// YOUR CODE HERE.

// 3. Fill in the user information in a way that Vanilla can understand.
if ($signedIn) {
    // CHANGE THESE FOUR LINES.
  	$jsConnect
        ->setUniqueID('123')
      	->setName('Username')
      	->setEmail('[email protected]')
      	->setPhotoUrl('https://example.com/avatar.jpg');
} else {
  $jsConnect->setGuest(true);
}

// 4. Generate the jsConnect response and redirect.
$jsConnect->handleReques($_GET);

Functional Usage

The functional usage is mainly for backwards compatibility. If you are currently using this method then you can continue to do so. However, you may want to port your code to the object oriented method when you have time.

Here is an example of the functional usage:

// 1. Get your client ID and secret here. These must match those in your jsConnect settings.
$clientID = "1234";
$secret = "1234";

// 2. Grab the current user from your session management system or database here.
$signedIn = true; // this is just a placeholder

// YOUR CODE HERE.

// 3. Fill in the user information in a way that Vanilla can understand.
$user = array();

if ($signedIn) {
    // CHANGE THESE FOUR LINES.
    $user['uniqueid'] = '123';
    $user['name'] = 'John PHP';
    $user['email'] = '[email protected]';
    $user['photourl'] = '';
}

// 4. Generate the jsConnect string.

// This should be true unless you are testing.
// You can also use a hash name like md5, sha1 etc which must be the name as the connection settings in Vanilla.
$secure = true;
writeJsConnect($user, $_GET, $clientID, $secret, $secure);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].