{"id":19503425,"url":"https://github.com/oops-org-php/oauth2","last_synced_at":"2025-07-24T00:37:30.583Z","repository":{"id":254606322,"uuid":"59418802","full_name":"OOPS-ORG-PHP/OAUTH2","owner":"OOPS-ORG-PHP","description":"PHP OAUTH2 authentication API - Azure, Facebook, Github, Google, Microsoft, Naver","archived":false,"fork":false,"pushed_at":"2020-07-01T07:10:14.000Z","size":76,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-25T21:44:07.962Z","etag":null,"topics":["azure-active-directory","facebook-login","github-login","google-login","kakao-login","microsoft-login","naver-login","oauth","oauth2","oauth2-client","php"],"latest_commit_sha":null,"homepage":"http://pear.oops.org/","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/OOPS-ORG-PHP.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-22T15:14:55.000Z","updated_at":"2023-10-05T07:57:35.000Z","dependencies_parsed_at":"2024-08-24T18:39:12.976Z","dependency_job_id":null,"html_url":"https://github.com/OOPS-ORG-PHP/OAUTH2","commit_stats":null,"previous_names":["oops-org-php/oauth2"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/OOPS-ORG-PHP/OAUTH2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OOPS-ORG-PHP%2FOAUTH2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OOPS-ORG-PHP%2FOAUTH2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OOPS-ORG-PHP%2FOAUTH2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OOPS-ORG-PHP%2FOAUTH2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OOPS-ORG-PHP","download_url":"https://codeload.github.com/OOPS-ORG-PHP/OAUTH2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OOPS-ORG-PHP%2FOAUTH2/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266774797,"owners_count":23982247,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["azure-active-directory","facebook-login","github-login","google-login","kakao-login","microsoft-login","naver-login","oauth","oauth2","oauth2-client","php"],"created_at":"2024-11-10T22:21:21.462Z","updated_at":"2025-07-24T00:37:30.554Z","avatar_url":"https://github.com/OOPS-ORG-PHP.png","language":"PHP","readme":"# OAUTH2 pear package\n![GitHub license](https://img.shields.io/badge/license-BSD-blue.svg)\n\n## License\n\nCopyright (c) 2020 JoungKyun.Kim \u0026lt;http://oops.org\u0026gt; All rights reserved\n\nThis program is under BSD license\n\n## Description\n\nThis is OAUTH2 login tool and support follow vendors:\n * Google\n * Facebook\n * Github\n * Naver\n * Kakao\n * Microsoft\n\n## Installation\n\nWe recommand to install with pear command cause of dependency pear packages.\n\n### 1. use pear command\n\n```bash\n[root@host ~]$ # add pear channel 'pear.oops.org'\n[root@host ~]$ pear channel-discover pear.oops.org\nAdding Channel \"pear.oops.org\" succeeded\nDiscovery of channel \"pear.oops.org\" succeeded\n[root@host ~]$ # add OAUTH2 pear package\n[root@host ~]$ pear install oops/OAUTH2\ndownloading OAUTH2-1.0.9.tgz ...\nStarting to download OAUTH2-1.0.9.tgz (10,893 bytes)\n....done: 10,893 bytes\ndownloading HTTPRelay-1.0.5.tgz ...\nStarting to download HTTPRelay-1.0.5.tgz (5,783 bytes)\n...done: 5,783 bytes\ndownloading myException-1.0.2.tgz ...\nStarting to download myException-1.0.2.tgz (3,048 bytes)\n...done: 3,048 bytes\ninstall ok: channel://pear.oops.org/myException-1.0.2\ninstall ok: channel://pear.oops.org/HTTPRelay-1.0.5\ninstall ok: channel://pear.oops.org/OAUTH2-1.0.9\n[root@host ~]$\n```\n\nIf you wnat to upgarde version:\n\n```bash\n[root@host ~]$ pear upgrade oops/OAUT2\n```\n\n\n### 2. install by hand\n\nGet last release at https://github.com/OOPS-ORG-PHP/OAUTH2/releases and uncompress pakcage within PHP include_path.\n\nYou must need follow dependency pear packages:\n * myException at https://github.com/OOPS-ORG-PHP/myException/releases/\n * HTTPRelay at https://github.com/OOPS-ORG-PHP/HTTPRelay/releases/\n\n## Usages\n\nRefence siste: http://pear.oops.org/docs/oops-OAUTH2/OAUth2.html\n\nreference is written by Korean. If you can't read korean, use [google translator](https://translate.google.com/translate?sl=auto\u0026tl=en\u0026js=y\u0026prev=_t\u0026hl=ko\u0026ie=UTF-8\u0026u=http%3A%2F%2Fpear.oops.org%2Fdocs%2Foops-OAUTH2%2FOAUth2.html\u0026edit-text=\u0026act=url).\n\n```php\n\u003c?php\nsession_start ();\n\nrequire_once 'OAUTH2.php';\n\nset_error_handler ('myException::myErrorHandler');\n\n// Callback URL is this page.\n$callback = sprintf (\n    '%s://%s%s',\n    $_SERVER['HTTPS'] ? 'https' : 'http',\n    $_SERVER['HTTP_HOST'],\n    $_SERVER['REQUEST_URI']\n);\n\n$appId = (object) array (\n    'vendor'   =\u003e 'google',\n    'id'       =\u003e 'APPLICATION_ID',\n    'secret'   =\u003e 'APPLICATION_SECRET_KEY',\n    'callback' =\u003e $callback,\n);\n\ntry {\n    $oauth2 = new oops\\OAUTH2 ($appId);\n\n    // If you want to logout, give logout parameter at callback url.\n    // If you need redirect after logout, give redrect parameter.\n    // For example:\n    //  http://callback_url?logout\u0026redirect=http%3A%2F%2Fredirect_url\n    if ( isset ($_GET['logout']) ) {\n        unset ($_SESSION['oauth2']);\n\n        if ( $_GET['redirect'] )\n            Header ('Location: ' . $redirect);\n\n        printf ('%s Complete logout', strtoupper ($appId-\u003evendor));\n        exit;\n    }\n\n    $user = $oauth2-\u003eProfile ();\n    $uid = sprintf ('%s:%s', $appId-\u003evendor, $user-\u003eid);\n    $_SESSION['oauth2'] = (object) array (\n        'uid' =\u003e $uid,\n        'name' =\u003e $user-\u003ename,\n        'email' =\u003e $user-\u003eemail,\n        'img' =\u003e $user-\u003eimg,\n        'logout' =\u003e $callback . '?logout'\n    );\n\n    print_r ($_SESS['oauth2']);\n} catch ( myException $e ) {\n    echo $e-\u003eMessage () . \"\\n\";\n    print_r ($e-\u003eTraceAsArray);\n    $e-\u003efinalize ();\n}\n?\u003e\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foops-org-php%2Foauth2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foops-org-php%2Foauth2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foops-org-php%2Foauth2/lists"}