{"id":20042495,"url":"https://github.com/code4mk/kauth","last_synced_at":"2025-05-05T08:32:34.114Z","repository":{"id":56980690,"uuid":"169710608","full_name":"code4mk/kauth","owner":"code4mk","description":"🔑 kauth is  JWT API Authentication ( jwt-auth ) for laravel","archived":false,"fork":false,"pushed_at":"2019-12-04T21:08:24.000Z","size":20,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T19:52:42.130Z","etag":null,"topics":["0devco","auth","code4mk","jwt-auth","kauth","laravel","laravel-api","laravel-auth","laravel-jwt"],"latest_commit_sha":null,"homepage":"https://code4mk.org/kauth/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/code4mk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-08T09:22:45.000Z","updated_at":"2020-01-10T19:26:44.000Z","dependencies_parsed_at":"2022-08-21T08:40:43.128Z","dependency_job_id":null,"html_url":"https://github.com/code4mk/kauth","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/code4mk%2Fkauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code4mk%2Fkauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code4mk%2Fkauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code4mk%2Fkauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/code4mk","download_url":"https://codeload.github.com/code4mk/kauth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252466897,"owners_count":21752458,"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":["0devco","auth","code4mk","jwt-auth","kauth","laravel","laravel-api","laravel-auth","laravel-jwt"],"created_at":"2024-11-13T10:51:58.616Z","updated_at":"2025-05-05T08:32:33.709Z","avatar_url":"https://github.com/code4mk.png","language":"PHP","readme":"![kauth](https://user-images.githubusercontent.com/17185462/52489899-aa8b2500-2bed-11e9-8092-9b44bb827d17.png)\n\n# `kauth`\nkauth is JWT API Authentication ( jwt-auth ) for laravel\n\n\n# Installation\nyou can install kauth package by command\n```bash\ncomposer require code4mk/kauth\n```\n# Setup\n\n### 1) Vendor publish.\n\n```bash\nphp artisan vendor:publish --provider=\"Kauth\\KauthServiceProvider\" --tag=config\nphp artisan vendor:publish --provider=\"Kauth\\KauthServiceProvider\" --tag=migations\n```\n### 2) Config setup\n\n* `config\\kauth.php`\n\n* set `token_header_name` that you can use with guzzle or axios header\n* default `token_header_name` name is `tokon`\n\n# Usage\n\n## `Kauth::attempt()` functions\n\n* guard('name')\n```php\n// guard name will be user table name\nKauth::guard(\"users\")\n```\n* socialite()-\u003eattempt()\n```php\n// laravel socialite system\n// credential will be only email\nKauth::guard(\"users\")-\u003esocialite()\n        -\u003eattempt([\"email\"=\u003e\"ex@gmail.com\"]);\n```\n* normal attempt()\n```php\n// your all desired credentials\n// password credentail need\nKauth::guard(\"users\")\n  -\u003eattempt([\"email\"=\u003e\"ex@email.com\",\"password\"=\u003e1234])\n```\n\n~ `attempt() return a jwt token` which you pass with request header (ex:axios header)\n## attempt special\n\n* username credential will be optional as  (id|email|username) .  (ex: facebook username)\n* `usernames` describe which columns you want to match for username\n\n```php\nattempt([\"usernames\"=\u003e[\"id\",\"email\",\"name\"],\"username\"=\u003e\"request query for username\",\"password=\u003e123456\"]);\n```\n## Kauth::check()\n\n```php\nKauth::check();\n```\n## Kauth::id()\n\n```php\nKauth::id();\n```\n\n## Kauth::refreshToken()\n\n```php\nKauth::refreshToken()\n```\n\n## Kauth::logout()\n\n```php\nKauth::logout();\n```\n\n## Kauth::logoutOtherDevices()\n\n```php\nKauth::logoutOtherDevices();\n```\n\n\u003ca href=\"https://twitter.com/0devco\" target=\"_blank\" \u003e\u003cp align=\"center\" \u003e\u003cimg src=\"https://raw.githubusercontent.com/0devco/docs/master/.devco-images/logo-transparent.png\"\u003e\u003c/p\u003e\u003c/a\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode4mk%2Fkauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode4mk%2Fkauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode4mk%2Fkauth/lists"}