Skip to content

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