{"id":19312083,"url":"https://github.com/authentiqid/oauth2-authentiq-php","last_synced_at":"2026-05-16T15:33:50.902Z","repository":{"id":62489648,"uuid":"85065143","full_name":"AuthentiqID/oauth2-authentiq-php","owner":"AuthentiqID","description":"Authentiq as 3rd party provider in League/oauth2-client","archived":false,"fork":false,"pushed_at":"2017-08-23T13:31:49.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-06T02:27:06.179Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.authentiq.com/developers/","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/AuthentiqID.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":"2017-03-15T11:36:44.000Z","updated_at":"2017-08-23T13:30:12.000Z","dependencies_parsed_at":"2022-11-02T10:47:23.904Z","dependency_job_id":null,"html_url":"https://github.com/AuthentiqID/oauth2-authentiq-php","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AuthentiqID%2Foauth2-authentiq-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AuthentiqID%2Foauth2-authentiq-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AuthentiqID%2Foauth2-authentiq-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AuthentiqID%2Foauth2-authentiq-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AuthentiqID","download_url":"https://codeload.github.com/AuthentiqID/oauth2-authentiq-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240415215,"owners_count":19797599,"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":"2024-11-10T00:32:39.437Z","updated_at":"2025-11-16T15:05:00.614Z","avatar_url":"https://github.com/AuthentiqID.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Authentiq Provider for OAuth 2.0 Client\n\nThis package provides [Authentiq](https://www.authentiq.com/developers/?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=oauth2-authentiq-php) support for the PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client).\n\n## Installation\n\nTo install, use composer:\n\n```\ncomposer require authentiq/oauth2-authentiq\n```\n\n\n## Usage\n\nUsage is the same as The League's OAuth client, using `Authentiq\\OAuth2\\Client\\Provider\\Authentiq` as the provider.\n\n### Authorization Code Flow\n\n```php\n$provider = new Authentiq\\OAuth2\\Client\\Provider\\Authentiq([\n    'clientId'     =\u003e 'authentiq-client-id',\n    'clientSecret' =\u003e 'authentiq-client-secret',\n    'redirectUri'  =\u003e 'your-callback-url',\n    'scope'        =\u003e 'openid email~rs phone~r aq:name aq:push'\n]);\n\n// If we don't have an authorization code then get one\nif (!isset($_GET['code'])) {\n\n    // Fetch the authorization URL from the provider; this returns the\n    // urlAuthorize option and generates and applies any necessary parameters\n    // (e.g. state).\n    $authorizationUrl = $provider-\u003egetAuthorizationUrl();\n\n    // Get the state generated for you and store it to the session.\n    $_SESSION['oauth2state'] = $provider-\u003egetState();\n\n    // Redirect the user to the authorization URL.\n    header('Location: ' . $authorizationUrl);\n    exit;\n\n// Check given state against previously stored one to mitigate CSRF attack\n} elseif (empty($_GET['state']) || (isset($_SESSION['oauth2state']) \u0026\u0026 $_GET['state'] !== $_SESSION['oauth2state'])) {\n\n    if (isset($_SESSION['oauth2state'])) {\n        unset($_SESSION['oauth2state']);\n    }\n    exit('Invalid state');\n\n} else {\n    try {\n        // Try to get an the IdToken using the authorization code grant.\n        $idToken = $provider-\u003egetAccessToken('authorization_code', [\n            'code' =\u003e $_GET['code']\n        ]);\n\n        // Using the ID token, create the resource owner.\n        $resourceOwner = $provider-\u003egetResourceOwner($idToken);\n                \n        // Now the $resourceOwner contains all the user info you need to create the user, \n        // store the unique user id from the sub \n        // or present the info you asked for.\n\n\n    } catch (\\League\\OAuth2\\Client\\Provider\\Exception\\IdentityProviderException $e) {\n\n        // Failed to get the access token or user details.\n        exit($e-\u003egetMessage());\n\n    }\n}\n```\n\n## Refreshing a Token\n\nAuthentiq's OAuth implementation does not use refresh tokens.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauthentiqid%2Foauth2-authentiq-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauthentiqid%2Foauth2-authentiq-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauthentiqid%2Foauth2-authentiq-php/lists"}