{"id":25524773,"url":"https://github.com/ALTELMA/laravel-hydra","last_synced_at":"2026-01-01T03:30:17.600Z","repository":{"id":56946387,"uuid":"457903938","full_name":"ALTELMA/laravel-hydra","owner":"ALTELMA","description":"Ory Hydra Client API for PHP that support Laravel","archived":false,"fork":false,"pushed_at":"2024-10-22T07:21:40.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-18T05:55:46.793Z","etag":null,"topics":[],"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/ALTELMA.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}},"created_at":"2022-02-10T18:40:31.000Z","updated_at":"2024-10-22T07:21:43.000Z","dependencies_parsed_at":"2022-08-21T07:20:30.302Z","dependency_job_id":null,"html_url":"https://github.com/ALTELMA/laravel-hydra","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALTELMA%2Flaravel-hydra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALTELMA%2Flaravel-hydra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALTELMA%2Flaravel-hydra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALTELMA%2Flaravel-hydra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ALTELMA","download_url":"https://codeload.github.com/ALTELMA/laravel-hydra/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239605123,"owners_count":19666998,"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":[],"created_at":"2025-02-19T20:05:34.941Z","updated_at":"2026-01-01T03:30:17.477Z","avatar_url":"https://github.com/ALTELMA.png","language":"PHP","funding_links":[],"categories":["Archived, Outdated, and WIP"],"sub_categories":["Ory Fosite"],"readme":"# Laravel Hydra\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/altelma/laravel-hydra.svg?style=flat-square)](https://packagist.org/packages/altelma/laravel-hydra)\n[![Total Downloads](https://poser.pugx.org/ALTELMA/laravel-hydra/d/total.svg)](https://packagist.org/packages/altelma/laravel-hydra)\n\nLaravel Hydra is a package that provides Client API for Hydra support Laravel and following the newest of PHP version.\n\n![Laravel Hydra Cover](https://user-images.githubusercontent.com/4938568/153674325-d98af9de-cd43-46de-a4ca-34b1b5935aa2.jpg)\n\n## What is Hydra?\nHydra is an OAuth 2.0 and OpenID Connect Provider. In other words, an implementation of the OAuth 2.0 Authorization Framework as well as the OpenID Connect Core 1.0 framework. As such, it issues OAuth 2.0 Access, Refresh, and ID Tokens that enable third-parties to access your APIs in the name of your users.\n\n## Inspiration ❤️❤️❤️\nThis is not the official Ory Hydra SDK for php.\nIf you want to use the official SDK, please use the official [Ory Hydra SDK](https://github.com/ory/hydra-client-php)\n\n## Installation\n``\ncomposer require altelma/laravel-hydra\n``\n\n## Usage\n\n### Create OAuth Client\n```\n// Create OAuth Client\n$adminApi = new AdminApi();\n$adminApi-\u003ecreateOAuth2Client([\n    \"client_id\" =\u003e \"my-client-id\",\n    \"client_name\" =\u003e \"My Client ID\",\n    \"client_secret\" =\u003e Str::random(32),\n    \"scope\" =\u003e \"offline offline_access openid phone email profile\",\n    \"owner\" =\u003e \"Your company or your 3rd\",\n    \"client_uri\" =\u003e \"https://your-company.com\",\n    \"logo_uri\" =\u003e \"https://your-client-app.com/logo.png\",\n    \"redirect_uris\" =\u003e [\n        \"http://localhost:8000/hydra/callback\",\n    ],\n    \"grant_types\" =\u003e [\n        \"authorization_code|refresh_token\"\n    ],\n    \"response_types\" =\u003e [\n        \"code|id_token\"\n    ],\n]);\n```\n\n### Token Verification\n```\n// Example in middleware\npublic function __construct(private AdminApi $oauthAdminApi)\n{\n}\n\npublic function handle(Request $request, Closure $next)\n{\n    $token = $request-\u003ebearerToken();\n    $tokenVerification = $this-\u003eoauthAdminApi-\u003eintrospectOAuth2Token($token)-\u003eactive;\n    if (!$tokenVerification) {\n        throw new UnauthorizedHttpException('Bearer', 'Invalid access token');\n    }\n\n    return $next($request);\n}\n```\n\n## Reference\nHTTP API Documentation: https://www.ory.sh/hydra/docs/reference/api\n\n## สนับสนุนผมได้นะ ☕\nสวัสดีเพื่อนๆ ทุกคนนะครับ หากมีข้อเสนอแนะอะไร แนะนำมาได้นะครับ \nนอกจากนี้ เพื่อนๆ สามารถแวะไปอ่านบทความของผมเพิ่มเติมได้ [ที่นี่](https://medium.com/@altelma) ครับ\n\n## Bug Report\nThis package is not perfect right, but can be improve together. If you found bug or have any suggestion. Send that to me or new issue. Thank you to use it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FALTELMA%2Flaravel-hydra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FALTELMA%2Flaravel-hydra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FALTELMA%2Flaravel-hydra/lists"}