{"id":15641766,"url":"https://github.com/dunglas/solid-client-php","last_synced_at":"2025-04-15T11:03:55.037Z","repository":{"id":41993503,"uuid":"478047232","full_name":"dunglas/solid-client-php","owner":"dunglas","description":"PHP library for accessing data and managing permissions on data stored in a Solid Pod","archived":false,"fork":false,"pushed_at":"2023-06-01T09:13:56.000Z","size":43,"stargazers_count":69,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-28T19:13:20.624Z","etag":null,"topics":["api-platform","oidc-client","php","solid","solid-pods","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":"https://dunglas.dev/2022/04/building-decentralized-web-apps-with-solid-and-php/","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/dunglas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"dunglas"}},"created_at":"2022-04-05T08:54:03.000Z","updated_at":"2024-11-13T12:35:00.000Z","dependencies_parsed_at":"2024-10-22T23:34:19.805Z","dependency_job_id":null,"html_url":"https://github.com/dunglas/solid-client-php","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":"0.11111111111111116","last_synced_commit":"5be21cbc166a5d05cd94840ca24d5eb90795feb3"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dunglas%2Fsolid-client-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dunglas%2Fsolid-client-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dunglas%2Fsolid-client-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dunglas%2Fsolid-client-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dunglas","download_url":"https://codeload.github.com/dunglas/solid-client-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249058372,"owners_count":21205910,"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":["api-platform","oidc-client","php","solid","solid-pods","symfony","symfony-bundle"],"created_at":"2024-10-03T11:45:01.233Z","updated_at":"2025-04-15T11:03:55.003Z","avatar_url":"https://github.com/dunglas.png","language":"PHP","readme":"# Solid Client PHP\n\n\u003e Re-decentralizing the web\n\n[Solid](https://solidproject.org) (derived from \"**so**cial **li**nked **d**ata\") is a proposed set of\nconventions and tools for building *decentralized Web applications* based on\n[Linked Data](http://www.w3.org/DesignIssues/LinkedData.html) principles.\n\nThis repository contains a PHP library for accessing data and managing permissions on data stored in a Solid Pod\nIt also a contains a Symfony bundle to easily build Solid applications with the [Symfony](https://symfony.com) and [API Platform](https://api-platform.com) frameworks.\n\nTake a look at [the presentation of this library at the SymfonyLive Paris 2022 conference](https://dunglas.fr/2022/04/building-decentralized-web-apps-with-solid-and-php/).\n\n## Install\n\n```\ncomposer require dunglas/solid-client-php\n```\n\nIf you use [Symfony](https://symfony.com) or [API Platform](https://api-platform.com),\nthe bundle and the corresponding recipe will be installed automatically.\n\n## Example\n\n```php\n\u003c?php\n\nuse Dunglas\\PhpSolidClient\\SolidClientFactory;\nuse Dunglas\\PhpSolidClient\\OidcClient;\nuse Symfony\\Component\\HttpClient\\HttpClient;\n\n$solidClientFactory = new SolidClientFactory(HttpClient::create());\n\n// Create an anonymous Solid client\n$anonymousSolidClient = $solidClientFactory-\u003ecreate();\n\n// Fetch the WebID profile of a user\n$profile = $anonymousSolidClient-\u003egetProfile('https://example.com/your/webid');\n// Fetch the OIDC issuer for a user\n$oidcIssuer = $anonymousSolidClient-\u003egetOidcIssuer('https://example.com/your/webid');\n\n// Create a Solid OIDC client for this user\n$oidcClient = new OidcClient($oidcIssuer);\n// Register the OIDC client dynamically\n$oidcClient-\u003eregister();\n// Authenticate the user\n$oidcClient-\u003eauthenticate();\n// At this point you may want to save $oidcClient in the session\n// The user will be redirected to the OIDC server to log in\n\n// Create a Solid client generating DPoP access tokens for the logged-in user\n$loggedSolidClient = $solidClientFactory-\u003ecreate($oidcClient);\n\n// Create a new container\n$containerResponse = $loggedSolidClient-\u003ecreateContainer('https://mypod.example.com', 'blog');\n$container = $containerResponse-\u003egetContent();\n\n// Post a new note\n$apiPlatformResponse = $loggedSolidClient-\u003epost('https://mypod.example.com/blog', 'api-platform-conference', \u003c\u003c\u003cTTL\n@prefix as: \u003chttp://www.w3.org/ns/activitystreams#\u003e.\n\n\u003c\u003e a as:Note; as:content \"Going to API Platform Conference\".\nTTL\n);\n$apiPlatformCon = $apiPlatformResponse-\u003egetContent();\n\n// Fetch an existing note\n$symfonyLiveResponse = $loggedSolidClient-\u003eget('https://mypod.example.com/blog/symfony-live');\n$symfonyLive = $symfonyLiveResponse-\u003egetContent();\n\n// Logout\n$oidcClient-\u003esignOut($oidcClient-\u003egetIdToken());\n```\n\n## Features\n\n* Standalone PHP library\n* Symfony Bundle\n  * OAuth/OIDC authenticator\n  * Solid client as a service\n\n### Authentication\n\n* Modern and Fully featured [OAuth](https://datatracker.ietf.org/doc/html/rfc6749) and [OpenID Connect](https://openid.net/connect/) client (work even without Solid, extends [`jumbojett/openid-connect-php`](https://github.com/jumbojett/OpenID-Connect-PHP))\n  * [Elliptic Curve Digital Signature Algorithm (ECDSA)](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm) JWT/JWK keys (uses [JWT Framework](https://web-token.spomky-labs.com))\n  * [Demonstrating Proof-of-Possession at the Application Layer (DPoP)](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-dpop)\n* [Solid OIDC](https://solid.github.io/solid-oidc/primer/)\n\n### Identity\n\n* [WebID](https://www.w3.org/2005/Incubator/webid/spec/identity/)\n* [Solid WebID Profiles](https://github.com/solid/solid-spec/blob/master/solid-webid-profiles.md)\n\n### Reading and Writing Resources\n\n* [Linked Data Platform](https://www.w3.org/TR/ldp/)\n* [Solid HTTPS REST API](https://github.com/solid/solid-spec/blob/master/api-rest.md) (uses [Symfony HttpClient](https://symfony.com/doc/current/http_client.html))\n* [Solid Content Representation](https://github.com/solid/solid-spec/blob/master/content-representation.md) (delegated to [EasyRDF](https://www.easyrdf.org/))\n\n## Not Implemented Yet\n\n* [OAuth Client ID](https://solid.github.io/solid-oidc/primer/#authorization-code-pkce-flow-step-7)\n* [Solid OIDC \"Request Flow\"](https://solid.github.io/solid-oidc/primer/#request-flow) (currently not supported by mainstream Solid servers)\n* [Web Access Control](https://solidproject.org/TR/wac)\n* [WebSockets API](https://github.com/solid/solid-spec#websockets-api=)\n* [Social Web App Protocols](https://github.com/solid/solid-spec#social-web-app-protocols)\n* [WebID-TLS](https://github.com/solid/solid-spec#webid-tls=) (not supported anymore in web browsers)\n* Symfony Bundle\n  * Redirect after login\n","funding_links":["https://github.com/sponsors/dunglas"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdunglas%2Fsolid-client-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdunglas%2Fsolid-client-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdunglas%2Fsolid-client-php/lists"}