{"id":14987404,"url":"https://github.com/michalsn/codeigniter-kinde","last_synced_at":"2025-04-12T00:15:15.714Z","repository":{"id":184374893,"uuid":"670606100","full_name":"michalsn/codeigniter-kinde","owner":"michalsn","description":"Basic integration for Kinde authentication","archived":false,"fork":false,"pushed_at":"2024-02-06T03:26:05.000Z","size":68,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-04-12T00:15:00.957Z","etag":null,"topics":["authentication","codeigniter","codeigniter4","kinde","multifactor-authentication","passwordless-authentication","php","php8","sso-authentication"],"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/michalsn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-25T12:31:06.000Z","updated_at":"2024-12-22T07:42:18.000Z","dependencies_parsed_at":"2023-07-28T07:45:25.626Z","dependency_job_id":"69569b8f-0f3f-41c1-8f09-4faa3442164d","html_url":"https://github.com/michalsn/codeigniter-kinde","commit_stats":{"total_commits":37,"total_committers":2,"mean_commits":18.5,"dds":"0.29729729729729726","last_synced_commit":"b49929f0ca307384e8b25de40ddec07a8463d138"},"previous_names":["michalsn/codeigniter-kinde"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalsn%2Fcodeigniter-kinde","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalsn%2Fcodeigniter-kinde/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalsn%2Fcodeigniter-kinde/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalsn%2Fcodeigniter-kinde/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michalsn","download_url":"https://codeload.github.com/michalsn/codeigniter-kinde/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248497818,"owners_count":21113984,"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":["authentication","codeigniter","codeigniter4","kinde","multifactor-authentication","passwordless-authentication","php","php8","sso-authentication"],"created_at":"2024-09-24T14:14:34.086Z","updated_at":"2025-04-12T00:15:15.688Z","avatar_url":"https://github.com/michalsn.png","language":"PHP","readme":"# CodeIgniter Kinde\n\nBasic integration for [Kinde](https://kinde.com/) authentication.\n\n[![PHPStan](https://github.com/michalsn/codeigniter-kinde/actions/workflows/phpstan.yml/badge.svg)](https://github.com/michalsn/codeigniter-kinde/actions/workflows/phpstan.yml)\n[![PHPCPD](https://github.com/michalsn/codeigniter-kinde/actions/workflows/phpcpd.yml/badge.svg)](https://github.com/michalsn/codeigniter-kinde/actions/workflows/phpcpd.yml)\n[![Psalm](https://github.com/michalsn/codeigniter-kinde/actions/workflows/psalm.yml/badge.svg)](https://github.com/michalsn/codeigniter-kinde/actions/workflows/psalm.yml)\n[![Rector](https://github.com/michalsn/codeigniter-kinde/actions/workflows/rector.yml/badge.svg)](https://github.com/michalsn/codeigniter-kinde/actions/workflows/rector.yml)\n[![Deptrac](https://github.com/michalsn/codeigniter-kinde/actions/workflows/deptrac.yml/badge.svg)](https://github.com/michalsn/codeigniter-kinde/actions/workflows/deptrac.yml)\n\n![PHP](https://img.shields.io/badge/PHP-%5E8.0-blue)\n![CodeIgniter](https://img.shields.io/badge/CodeIgniter-%5E4.3-blue)\n\n### Installation\n\n#### Composer\n\n    composer require michalsn/codeigniter-kinde\n\n#### Manually\n\nIn the example below we will assume, that files from this project will be located in `app/ThirdParty/kinde` directory.\n\nDownload this project and then enable it by editing the `app/Config/Autoload.php` file and adding the `Michalsn\\CodeIgniterKinde` namespace to the `$psr4` array, like in the below example:\n\n```php\n\u003c?php\n\nnamespace Config;\n\nuse CodeIgniter\\Config\\AutoloadConfig;\n\nclass Autoload extends AutoloadConfig\n{\n    // ...\n    public $psr4 = [\n        APP_NAMESPACE =\u003e APPPATH, // For custom app namespace\n        'Config'      =\u003e APPPATH . 'Config',\n        'Michalsn\\CodeIgniterKinde' =\u003e APPPATH . 'ThirdParty/kinde/src',\n    ];\n\n    // ...\n```\nAlso add the required helper to the same file under `$files` array:\n\n```php\n    // ...\n    public $files = [\n        APPPATH . 'ThirdParty/kinde/src/Common.php',\n    ];\n\n    // ...\n```\n\n### Database\n\n    php spark migrate --all\n\n### Config\n\nSee what configuration variables can be set by looking at the `src/Config/Kinde.php` file and use the `.env` file to set them.\n\nSee the [getting started](https://kinde.com/docs/developer-tools/php-sdk/) article for reference.\n\n### Routes\n\n- `login`\n- `register`\n- `logout`\n- `callback`\n\n### Filers\n\n- `kinde`\n\n### Commands\n\nTo copy config file to the application namespace.\n\n    php spark kinde:publish\n\n### Helper functions\n\n- `authenticated()` will check if current user is authenticated\n- `can('permission')` will check if current user has a permission\n- `user_id()` will return current user ID (database)\n- `user()` or `user('field')` will return current user info (database)\n- `kinde_user()` will return the Kinde user array or `null`\n\n### Example\n\n```php\n\u003c?php\n\nnamespace App\\Controllers;\n\nclass Home extends BaseController\n{\n    public function index()\n    {\n        if (! service('kinde')-\u003eisAuthenticated()) {\n            return $this-\u003eresponse-\u003esetHeader(401)-\u003esetBody('401 Unauthorized');\n        }\n\n        if (! can('view:home')) {\n            return $this-\u003eresponse-\u003esetHeader(401)-\u003esetBody('Not enough permissions to view this page');\n        }\n\n        return view('home/index', $data);\n    }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichalsn%2Fcodeigniter-kinde","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichalsn%2Fcodeigniter-kinde","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichalsn%2Fcodeigniter-kinde/lists"}