PHPackages                             kalyanakrishnakondapalli/laravel-okta - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. kalyanakrishnakondapalli/laravel-okta

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

kalyanakrishnakondapalli/laravel-okta
=====================================

Laravel package for Okta OIDC integration (Web + API).

v1.0.0(10mo ago)00MITPHPPHP &gt;=8.1

Since Aug 30Pushed 10mo agoCompare

[ Source](https://github.com/kalyanakkondapalli/laravel-okta-plugin)[ Packagist](https://packagist.org/packages/kalyanakrishnakondapalli/laravel-okta)[ RSS](/packages/kalyanakrishnakondapalli-laravel-okta/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (2)Used By (0)

Laravel Okta Plugin
===================

[](#laravel-okta-plugin)

A Laravel package to integrate **Okta Authentication** with both **API** and **Web routes**.

---

📦 Installation
--------------

[](#-installation)

### 1. Install via Composer

[](#1-install-via-composer)

If package is on Packagist:

```
composer require kalyanakrishnakondapalli/laravel-okta-plugin
```

If using GitHub directly:

```
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/kalyanakrishnakondapalli/laravel-okta-plugin.git"
    }
]
```

then run:

```
composer require kalyanakrishnakondapalli/laravel-okta-plugin:dev-main
```

---

### 2. Publish Config

[](#2-publish-config)

Run the following command to publish the package configuration:

```
php artisan vendor:publish --provider="LaravelOktaPlugin\OktaServiceProvider" --tag="config"
```

This will create `config/okta.php` in your Laravel app.

---

### 3. Configure `.env`

[](#3-configure-env)

Add your Okta credentials to `.env`:

```
OKTA_DOMAIN=dev-xxxxxx.okta.com
OKTA_CLIENT_ID=your_client_id
OKTA_CLIENT_SECRET=your_client_secret
OKTA_REDIRECT_URI=http://localhost:8000/callback
```

---

🚀 Usage
-------

[](#-usage)

### ✅ Web Authentication

[](#-web-authentication)

Add login and dashboard routes in `routes/web.php`:

```
use Illuminate\Support\Facades\Route;

Route::get('/login', function () {
    return redirect()->route('okta.login');
});

Route::get('/callback', [\LaravelOktaPlugin\Http\Controllers\OktaController::class, 'callback'])
    ->name('okta.callback');

Route::get('/dashboard', function () {
    return view('dashboard');
})->middleware('okta.web');
```

When a user visits `/login`, they will be redirected to Okta for authentication.
After successful login, Okta redirects back to `/callback` and stores the user in session.
The `/dashboard` route is protected by the `okta.web` middleware.

---

### ✅ API Authentication

[](#-api-authentication)

Protect your API routes in `routes/api.php`:

```
use Illuminate\Support\Facades\Route;

Route::middleware(['okta.api'])->group(function () {
    Route::get('/user', function () {
        return response()->json(auth()->user());
    });

    Route::get('/secure-data', function () {
        return response()->json([
            'message' => 'This is protected by Okta API authentication.'
        ]);
    });
});
```

Here:

- `okta.api` middleware validates the **JWT access token** from Okta.
- Clients must pass a valid token in the `Authorization: Bearer ` header.

Example API call with cURL:

```
curl -H "Authorization: Bearer " http://localhost:8000/api/user
```

---

🔐 Middleware
------------

[](#-middleware)

The package provides two middlewares:

- `okta.web` → Protects web routes using Okta OAuth login flow.
- `okta.api` → Protects API routes by validating Okta JWT tokens.

Register them automatically via the service provider.

---

🛠 Development Setup
-------------------

[](#-development-setup)

If you want to clone and develop this package locally:

```
git clone https://github.com/kalyanakrishnakondapalli/laravel-okta-plugin.git
cd laravel-okta-plugin
composer install
```

---

📤 Publishing to GitHub &amp; Packagist
--------------------------------------

[](#-publishing-to-github--packagist)

### 1. Initialize Git

[](#1-initialize-git)

```
git init
git add .
git commit -m "Initial commit - Laravel Okta Plugin"
```

### 2. Create GitHub Repo

[](#2-create-github-repo)

Go to [GitHub → New Repository](https://github.com/new)
Example name: **laravel-okta-plugin**

### 3. Connect Local Repo

[](#3-connect-local-repo)

```
git branch -M main
git remote add origin https://github.com/kalyanakrishnakondapalli/laravel-okta-plugin.git
git push -u origin main
```

### 4. Tag a Release

[](#4-tag-a-release)

Packagist requires version tags:

```
git tag v1.0.0
git push origin v1.0.0
```

### 5. Submit to Packagist

[](#5-submit-to-packagist)

- Go to [Packagist.org](https://packagist.org/packages/submit)
- Submit: `https://github.com/kalyanakrishnakondapalli/laravel-okta-plugin`

Now others can install via:

```
composer require kalyanakrishnakondapalli/laravel-okta-plugin
```

---

👤 Author
--------

[](#-author)

**Kalyana Krishna Kondapalli**
📧

---

📄 License
---------

[](#-license)

MIT

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance54

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

309d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/76418302?v=4)[kalyanakkondapalli](/maintainers/kalyanakkondapalli)[@kalyanakkondapalli](https://github.com/kalyanakkondapalli)

---

Top Contributors

[![kalyanakkondapalli](https://avatars.githubusercontent.com/u/76418302?v=4)](https://github.com/kalyanakkondapalli "kalyanakkondapalli (1 commits)")

### Embed Badge

![Health badge](/badges/kalyanakrishnakondapalli-laravel-okta/health.svg)

```
[![Health](https://phpackages.com/badges/kalyanakrishnakondapalli-laravel-okta/health.svg)](https://phpackages.com/packages/kalyanakrishnakondapalli-laravel-okta)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k108.5M887](/packages/laravel-socialite)[directorytree/ldaprecord-laravel

LDAP Authentication &amp; Management for Laravel.

5752.3M18](/packages/directorytree-ldaprecord-laravel)[illuminate/auth

The Illuminate Auth package.

10528.2M1.2k](/packages/illuminate-auth)[kovah/laravel-socialite-oidc

OpenID Connect OAuth2 Provider for Laravel Socialite

24134.1k](/packages/kovah-laravel-socialite-oidc)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
