{"id":20011799,"url":"https://github.com/micro-php/plugin-oauth2-client","last_synced_at":"2026-04-01T19:32:57.481Z","repository":{"id":65095787,"uuid":"581939515","full_name":"Micro-PHP/plugin-oauth2-client","owner":"Micro-PHP","description":"Micro Framework: OAuth2 client based on \"league/oauth2-client\"","archived":false,"fork":false,"pushed_at":"2026-03-20T06:25:18.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-20T23:00:51.391Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Micro-PHP.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":"2022-12-25T00:29:16.000Z","updated_at":"2023-11-07T16:49:43.000Z","dependencies_parsed_at":"2024-07-06T21:50:56.515Z","dependency_job_id":null,"html_url":"https://github.com/Micro-PHP/plugin-oauth2-client","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Micro-PHP/plugin-oauth2-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Micro-PHP%2Fplugin-oauth2-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Micro-PHP%2Fplugin-oauth2-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Micro-PHP%2Fplugin-oauth2-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Micro-PHP%2Fplugin-oauth2-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Micro-PHP","download_url":"https://codeload.github.com/Micro-PHP/plugin-oauth2-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Micro-PHP%2Fplugin-oauth2-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2024-11-13T07:27:34.192Z","updated_at":"2026-04-01T19:32:54.983Z","avatar_url":"https://github.com/Micro-PHP.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Micro Framework Oauth2 client plugin\n\nMicro Framework: OAuth2 client based on \"league/oauth2-client\"\n## Installation\n\nInstall plugin with composer\n\n```bash\n$ composer require micro/plugin-oauth2-client\n```\n\nAnd install a specific provider(s).\n\nAvailable providers:\n[micro/plugin-oauth2-client-keycloak]()\n\nАnd then add plugin to the list of plugins (etc/plugins.php)\n\n```php\n\n$pluginsCommon = [\n    //....OTHER PLUGINS ....\n    Micro\\Plugin\\OAuth2\\Client\\OAuth2ClientPlugin::class,\n    Micro\\Plugin\\OAuth2\\Client\\Keycloak\\OAuth2KeycloakProviderPlugin::class,\n];\n\n```\nConfigure your oauth2 providers\n\nThe adapter configuration template usually looks like this `MICRO_OAUTH2_\u003cPROVIDER_NAME\u003e_\u003cPROVIDER_SETTING\u003e`\n\nDefault  adapter name \"default\"\n\n\n```dotenv\nMICRO_OAUTH2_DEFAULT_TYPE=keycloak\nMICRO_OAUTH2_DEFAULT_CLIENT_ID=\u003cmy-client-id\u003e\nMICRO_OAUTH2_DEFAULT_CLIENT_SECRET=\u003cclient-secret-key\u003e\nMICRO_OAUTH2_DEFAULT_CLIENT_URL_AUTHORIZATION=\u003cauth url\u003e\nMICRO_OAUTH2_DEFAULT_CLIENT_URL_REDIRECT=\u003credirect url\u003e\n```\n\n\n## Usage/Examples\n\nIndex document\n\n```php\n\nuse use Micro\\Plugin\\OAuth2\\Client\\Facade\\Oauth2ClientFacadeInterface;\n\n/** Unauthorized user */ \n$client = $container-\u003eget(Oauth2ClientFacadeInterface::class);\n$provider = $client-\u003egetProvider('default');\n\n$provider-\u003egetAuthorizationUrl(); This method will return the full path to the server for user authorization.\n\n\n/*** Response from the authorization server with a code */\n$accessToken    = $provider-\u003egetAccessToken('authorization_code', [\n    'code'  =\u003e $_GET['code'],\n]);\n\n$owner = $provider-\u003egetResourceOwner($accessToken);\n\n$id = $owner-\u003egetId();\n$ownerData = $owner-\u003etoArray(); //Associated data with the user.\n\n```\n\n\n## Support\n\nFor support, email head.trackingsoft@gmail.com.\n\n\n## Authors\n\n- [@stanislau_komar](https://www.github.com/asisyas)\n\n\n## License\n\n[MIT](LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicro-php%2Fplugin-oauth2-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicro-php%2Fplugin-oauth2-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicro-php%2Fplugin-oauth2-client/lists"}