{"id":28763464,"url":"https://github.com/verbb/example-formie-oauth-integration","last_synced_at":"2025-06-17T09:09:25.065Z","repository":{"id":230316434,"uuid":"779084111","full_name":"verbb/example-formie-oauth-integration","owner":"verbb","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-29T10:34:37.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-21T11:35:46.902Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/verbb.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}},"created_at":"2024-03-29T02:15:52.000Z","updated_at":"2024-03-29T02:18:02.000Z","dependencies_parsed_at":"2024-03-29T03:27:01.149Z","dependency_job_id":"2d81f35c-117c-470e-a64d-7008d7f9fa47","html_url":"https://github.com/verbb/example-formie-oauth-integration","commit_stats":null,"previous_names":["verbb/example-formie-oauth-integration"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/verbb/example-formie-oauth-integration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verbb%2Fexample-formie-oauth-integration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verbb%2Fexample-formie-oauth-integration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verbb%2Fexample-formie-oauth-integration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verbb%2Fexample-formie-oauth-integration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/verbb","download_url":"https://codeload.github.com/verbb/example-formie-oauth-integration/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verbb%2Fexample-formie-oauth-integration/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260326769,"owners_count":22992386,"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-06-17T09:09:24.295Z","updated_at":"2025-06-17T09:09:25.023Z","avatar_url":"https://github.com/verbb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Example Formie OAuth Integration\nThis is an example [Craft CMS](https://www.craftcms.com/) module for [Formie](https://github.com/verbb/formie) that shows how using the [Auth module](https://github.com/verbb/auth) can be used to connect with OAuth-based providers.\n\n\u003e [!NOTE]\n\u003e New to modules? Read our [blog post](https://verbb.io/blog/everything-you-need-to-know-about-modules) on getting started.\n\nThe following guide uses [Zoho CRM](https://www.zoho.com/en-au/crm/) to provider a real-world and working example. \n\nWe cover two approaches.\n\n## Using a `GenericProvider`\nThe simplest approach is to use the `verbb\\auth\\providers\\Generic` class for your integration. This takes care of many provider use-cases, where you just want to provide some endpoint URLs and maybe some scopes.\n\n```php\n\u003c?php\nnamespace modules\\formieoauth\\integrations;\n\nuse verbb\\formie\\base\\Crm;\n\nuse verbb\\auth\\base\\OAuthProviderInterface;\nuse verbb\\auth\\providers\\Generic as GenericProvider;\n\nclass ExampleCrmOAuthAlt extends Crm implements OAuthProviderInterface\n{\n    public static function getOAuthProviderClass(): string\n    {\n        return GenericProvider::class;\n    }\n\n    public function getOAuthProviderConfig(): array\n    {\n        $config = parent::getOAuthProviderConfig();\n        $config['urlAuthorize'] = 'https://accounts.zoho.com/oauth/v2/auth';\n        $config['urlAccessToken'] = 'https://accounts.zoho.com/oauth/v2/token';\n        $config['urlResourceOwnerDetails'] = 'https://accounts.zoho.com/oauth/user/info';\n        $config['scopes'] = ['aaaserver.profile.READ'];\n        $config['scopeSeparator'] = ' ';\n\n        return $config;\n    }\n}\n```\n\nHere, we tell the Formie integration which [Auth](https://github.com/verbb/auth) provider to use. If there's already a supported provider there, you should use that!\n\nThen, we use `getOAuthProviderConfig()` to provide any additional [`league/oauth2-client`](https://github.com/thephpleague/oauth2-client) settings for the provider.\n\n## Custom Auth class\nThe more involved approach is to create your own [`league/oauth2-client`](https://github.com/thephpleague/oauth2-client) client, where you have total control over the logic of authentication.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverbb%2Fexample-formie-oauth-integration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fverbb%2Fexample-formie-oauth-integration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverbb%2Fexample-formie-oauth-integration/lists"}