Download the PHP package bbs-lab/nova-okta without Composer

On this page you can find all versions of the php package bbs-lab/nova-okta. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nova-okta

Nova Okta

Latest Version on Packagist Tests Total Downloads

Okta SSO for Laravel Nova. Ships a custom Nova-styled login screen with a Log In with Okta button and an optional Fortify two-factor challenge bridge, so any Laravel Nova project gets Okta login by requiring the package and setting a few env vars. The login screen respects your Nova branding — it renders nova.brand.logo (or the name) and uses nova.brand.colors for the primary colour, including the Okta button.

It is the Nova adapter for bbs-lab/laravel-okta, which is installed automatically and owns the framework-agnostic Okta flow: the Socialite driver, the login / callback / logout controller, the user resolver, and the lifecycle hooks. This package adds the Nova-specific parts — the login screen, the login override and the 2FA bridge — and points the base flow at Nova's guard and path.

Requirements

Installation

Nova is a paid package, so authenticate against its Composer repository first, then require the package:

Both service providers are auto-discovered.

Okta application

In your Okta admin, create an OIDC / Web application and set:

where {nova-path} is your config('nova.path') (e.g. nova, or empty when Nova is mounted at the root). These paths are configurable — see Routes.

Credentials

Add the okta block to config/services.php (the package intentionally does not own your credentials):

OKTA_BASE_URL is the bare org URL (no /oauth2). Keep the redirect key present (it may be null).

OKTA_REDIRECT_URI is optional. The redirect URI is a route this package generates (under your Nova path), so when it is not set the package derives it from the callback route automatically — you only declare the matching Sign-in redirect URI in your Okta application. Set it only to override the derived URL (e.g. behind a reverse proxy).

Configuration

Nova-specific options

Okta behaviour (from the base)

The route paths, SSO logout, verified-email enforcement and stable-identifier matching live in the base package's config/okta.php:

User resolution, gating & lifecycle hooks

There is deliberately no user-mapping config — the base resolves an Okta account through Nova's guard's own user provider (by a stable id column then a verified email, never creating a user), and everything else is a hook on the BBSLab\LaravelOkta\Facades\Okta facade (resolveUserUsing, authorizeUserToLogin, beforeLogin, afterLogin, onLoginDenied) or a custom BBSLab\LaravelOkta\Contracts\OktaUserResolver.

The default resolver does not gate — it signs in any user it finds by email. Deciding who may sign in is your job. Set an authorization rule for a Nova panel.

For Nova, gate the Okta sign-in and/or Nova's own access gate — for example in your App\Providers\NovaServiceProvider:

authorizeUserToLogin stops a disallowed account at the SSO boundary (nothing is logged in, and onLoginDenied fires); viewNova is Nova's own gate that also guards password logins and every subsequent request. Use either or both.

See the bbs-lab/laravel-okta README for the hooks, the stable-identifier config, and how to extend DefaultOktaUserResolver for a reusable gate. A denied login flashes the error to the custom login screen.

How it works

The base registers the Okta Socialite driver and mounts these routes; this package adds the login override and the 2FA bridge. Every URI is prefixed by your Nova path — config('nova.path') (nova by default), read at boot — so with Nova mounted at /backend-panel the callback is /backend-panel/authorization-code/callback. Below, {nova-path} stands for that prefix:

Route (default URI) Name Purpose
GET {nova-path}/login nova.pages.login Overrides Nova's login GET with the package screen (POST stays Fortify's nova.login).
GET {nova-path}/authorization-code/redirect nova-okta.login Redirects to Okta (start login).
GET {nova-path}/authorization-code/callback nova-okta.callback Login callback — resolves the user and logs them in (the Sign-in redirect URI target).
GET {nova-path}/authorization-code/logout/redirect nova-okta.logout Logs out locally, and — when sso_logout is on — via Okta's OIDC end-session (start logout).
GET {nova-path}/authorization-code/logout nova-okta.callback.logout Okta's post-logout landing (this is the Sign-out redirect URI target).
GET {nova-path}/okta/two-factor-challenge two-factor.login Redirects Fortify's 2FA step to Nova's own challenge (when enabled).

The four authorization-code/* paths are configurable via the base package's okta.paths config (below); the route names are stable whatever the path, so reference them with route('nova-okta.login') rather than hard-coding a URI. When Nova is mounted at the root, {nova-path} is empty (e.g. /authorization-code/callback).

Logout name↔URI inversion (by design). nova-okta.logout initiates logout but mounts at the nested authorization-code/logout/redirect, while the post-logout landing nova-okta.callback.logout mounts at the short authorization-code/logout (the Okta sign-out redirect URI). Reference routes by name; do not swap the pairing.

The 2FA bridge is a redirect to Nova's native nova.two-factor.login (not a re-registration of its URI), so Nova keeps its middleware and the bridge is route:cache-safe.

Point Nova's user-menu logout link at the Okta-aware logout in your NovaServiceProvider:

Two-factor and forced enrolment

The 2FA challenge bridge (two-factor.login) lets a 2FA-enabled user complete the second factor on top of the custom login — enable Nova's 2FA in your NovaServiceProvider:

Forcing enrolment in 2FA is out of scope here — use bbs-lab/nova-force-two-factor. On an Okta login the base sets an okta_authenticated session flag so that package can skip forced enrolment for SSO users (Okta already enforces MFA).

Customising the login screen

Testing

Browser & live e2e

The browser (Pest v4) and live Playwright suites cover the pre-redirect login UX (the Okta button and the start of the OIDC redirect); the full SSO round-trip needs a real Okta org.

Security

Please email [email protected] for security issues instead of the issue tracker.

Changelog

See CHANGELOG.md.

Contributing

See CONTRIBUTING.md.

Credits

License

The MIT License (MIT). See LICENSE.md.


All versions of nova-okta with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
bbs-lab/laravel-okta Version ^3.0
illuminate/http Version ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^11.0 || ^12.0 || ^13.0
laravel/nova Version ^5.0
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bbs-lab/nova-okta contains the following files

Loading the files please wait ...