Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Laravel 12 demo integrating Infusionsoft (Keap) OAuth2 flow with token storage and contact fetch

umr4ever/laravel-infusionsoft-oauth-demo

Repository files navigation

Laravel Infusionsoft OAuth2 Demo

This is a Laravel 12 demo project showcasing how to integrate OAuth2 with Infusionsoft (Keap) using Guzzle HTTP client and Laravel, without relying on the official SDK. It covers the entire authentication flow, access token storage, refreshing, and consuming the API (fetching contacts) with a clean Laravel service structure.


๐Ÿ”ง Features

  • โœ… OAuth2 Authorization Flow with Infusionsoft
  • โœ… Token storage in database (access + refresh tokens)
  • โœ… Automatic token refresh if expired
  • โœ… Display real-time contacts from Infusionsoft on a Blade view
  • โœ… Laravel Service Class pattern used
  • โœ… Modular, clean code ready for production adaptation

๐Ÿ“ธ Screenshot

https://tinyurl.com/ynktjzhz


๐Ÿงฑ Folder Structure

app/
โ”œโ”€โ”€ Http/
โ”‚ โ””โ”€โ”€ Controllers/
โ”‚ โ””โ”€โ”€ InfusionsoftOAuth2Controller.php
โ”œโ”€โ”€ Models/
โ”‚ โ””โ”€โ”€ InfusionsoftToken.php
โ”œโ”€โ”€ Services/
โ”‚ โ””โ”€โ”€ InfusionsoftOAuth2.php
resources/
โ””โ”€โ”€ views/
 โ””โ”€โ”€ contacts.blade.php

๐Ÿš€ Setup Instructions

  1. Clone the Repository
git clone https://github.com/umr4ever/laravel-infusionsoft-oauth-demo.git
cd laravel-infusionsoft-oauth-demo
  1. Install Dependencies
composer install
cp .env.example .env
php artisan key:generate
  1. Set Infusionsoft Credentials in .env
INFUSIONSOFT_CLIENT_ID=your_client_id
INFUSIONSOFT_CLIENT_SECRET=your_client_secret
INFUSIONSOFT_DEV_REDIRECT_URI=http://127.0.0.1:8000/oauth/callback
  1. Configure Database

Set your local DB connection in .env, then run:

php artisan migrate
  1. Run the Application
php artisan serve
  1. Authorize App

Visit this URL to start OAuth2 flow:

http://127.0.0.1:8000/oauth/authorize
  1. Fetch Contacts

After authorization, access:

http://127.0.0.1:8000/contacts

๐Ÿ“ฆ API Used


๐Ÿ™‹โ€โ™‚๏ธ About the Author

๐Ÿ‘‹ Mohammad Umair
Senior Laravel Developer | 15+ Years of Experience
Remote from ๐Ÿ‡ฎ๐Ÿ‡ณ | Seeking full-time remote roles
๐Ÿ”— LinkedIn | ๐Ÿ”— GitHub


๐Ÿ“ License

This project is open-sourced under the MIT license.

About

Laravel 12 demo integrating Infusionsoft (Keap) OAuth2 flow with token storage and contact fetch

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle ใซใ‚ˆใฃใฆๅค‰ๆ›ใ•ใ‚ŒใŸใƒšใƒผใ‚ธ (->ใ‚ชใƒชใ‚ธใƒŠใƒซ) /