{"id":21522152,"url":"https://github.com/vinkashq/discourse-php","last_synced_at":"2025-07-08T11:33:14.782Z","repository":{"id":62544203,"uuid":"69977871","full_name":"vinkashq/discourse-php","owner":"vinkashq","description":"PHP library to authenticate your forum using Discourse Connect","archived":false,"fork":false,"pushed_at":"2024-11-23T17:37:38.000Z","size":31,"stargazers_count":8,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-12-28T09:27:21.057Z","etag":null,"topics":["discourse","discourse-connect","php","php-library"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vinkashq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-04T15:16:58.000Z","updated_at":"2024-11-23T17:34:28.000Z","dependencies_parsed_at":"2022-11-02T21:30:43.347Z","dependency_job_id":null,"html_url":"https://github.com/vinkashq/discourse-php","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinkashq%2Fdiscourse-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinkashq%2Fdiscourse-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinkashq%2Fdiscourse-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinkashq%2Fdiscourse-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vinkashq","download_url":"https://codeload.github.com/vinkashq/discourse-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248120706,"owners_count":21050997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discourse","discourse-connect","php","php-library"],"created_at":"2024-11-24T01:09:27.281Z","updated_at":"2025-04-09T22:22:52.574Z","avatar_url":"https://github.com/vinkashq.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# discourse-php\n\n[![Tests](https://github.com/vinkashq/discourse-php/actions/workflows/tests.yml/badge.svg)](https://github.com/vinkashq/discourse-php/actions/workflows/tests.yml) [![Packagist Version](https://img.shields.io/packagist/v/vinkas/discourse?logo=packagist\u0026logoColor=000000\u0026label=version\u0026labelColor=d9e0f3\u0026color=f28d1a)](https://packagist.org/packages/vinkas/discourse)\n\nPHP library to authenticate your forum using Discourse Connect\n\n## Installation\n\nThe package [`vinkas/discourse`](https://packagist.org/packages/vinkas/discourse) can be installed using composer via packagist.\n\n```\ncomposer require vinkas/discourse\n```\n\n## Documentation\n\n### Creating a Discourse client\n\n```php\n$discourse = new Vinkas\\Discourse\\Client('discourse.example.com', true);  // set true if ssl enabled\n```\n\n### Discourse Connect\n\n```\n$payload = $_GET['sso'];\n$signature = $_GET['sig'];\n\n$connect = $discourse-\u003econnect('SECRET', $payload, $signature);\n\nif (!($connect-\u003eisValid())) {\n    header(\"HTTP/1.1 403 Forbidden\");\n    echo(\"Bad Discourse Connect request\");\n    die();\n}\n\n$userParams = array(\n    'external_id' =\u003e 'USER_ID',\n    'email'     =\u003e 'EMAIL_ADDRESS',\n    'username' =\u003e 'USERNAME',  // optional\n    'name'     =\u003e 'FULL_NAME'  // optional\n    // for more available fields https://meta.discourse.org/t/13045\n);\n\n$url = $connect-\u003egetResponseUrl($userParams)\nheader('Location: ' . $url);\nexit(0);\n```\n\nVisit https://meta.discourse.org/t/setup-discourseconnect-official-single-sign-on-for-discourse-sso/13045 for more details about Discourse Connect.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinkashq%2Fdiscourse-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvinkashq%2Fdiscourse-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinkashq%2Fdiscourse-php/lists"}