2017 © Pedro Peláez
 

library discourse-php

Lets you use Discourse as the forum or community engine for a PHP website using API and SSO.

image

vinkas/discourse-php

Lets you use Discourse as the forum or community engine for a PHP website using API and SSO.

  • Saturday, January 28, 2017
  • by vinothkannans
  • Repository
  • 3 Watchers
  • 5 Stars
  • 986 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 2 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

discourse-php

Tests Packagist Version, (*1)

PHP library to authenticate your forum using Discourse Connect, (*2)

Installation

The package vinkas/discourse can be installed using composer via packagist., (*3)

composer require vinkas/discourse

Documentation

Creating a Discourse client

$discourse = new Vinkas\Discourse\Client('discourse.example.com', true);  // set true if ssl enabled

Discourse Connect

$payload = $_GET['sso'];
$signature = $_GET['sig'];

$connect = $discourse->connect('SECRET', $payload, $signature);

if (!($connect->isValid())) {
    header("HTTP/1.1 403 Forbidden");
    echo("Bad Discourse Connect request");
    die();
}

$userParams = array(
    'external_id' => 'USER_ID',
    'email'     => 'EMAIL_ADDRESS',
    'username' => 'USERNAME',  // optional
    'name'     => 'FULL_NAME'  // optional
    // for more available fields https://meta.discourse.org/t/13045
);

$url = $connect->getResponseUrl($userParams)
header('Location: ' . $url);
exit(0);

Visit https://meta.discourse.org/t/setup-discourseconnect-official-single-sign-on-for-discourse-sso/13045 for more details about Discourse Connect., (*4)

The Versions

28/01 2017

dev-master

9999999-dev

Lets you use Discourse as the forum or community engine for a PHP website using API and SSO.

  Sources   Download

MIT

The Requires

 

api sso discourse vinkas

14/11 2016

v1.0.4

1.0.4.0

Lets you use Discourse as the forum or community engine for a PHP website using API and SSO.

  Sources   Download

MIT

The Requires

 

api sso discourse vinkas

14/11 2016

v1.0.3

1.0.3.0

Lets you use Discourse as the forum or community engine for a PHP website using API and SSO.

  Sources   Download

MIT

The Requires

 

api sso discourse vinkas

14/10 2016

v1.0.2

1.0.2.0

Lets you use Discourse as the forum or community engine for a PHP website using API and SSO.

  Sources   Download

MIT

The Requires

 

api sso discourse vinkas

06/10 2016

v1.0.1

1.0.1.0

Lets you use Discourse as the forum or community engine for a PHP website using API and SSO.

  Sources   Download

MIT

The Requires

 

api sso discourse vinkas

05/10 2016

v1.0.0

1.0.0.0

Lets you use Discourse as the forum or community engine for a PHP website using API and SSO.

  Sources   Download

MIT

The Requires

 

api sso discourse vinkas