Download the PHP package winter/wn-sso-plugin without Composer

On this page you can find all versions of the php package winter/wn-sso-plugin. 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 wn-sso-plugin

Winter.SSO - Single Sign-On Plugin

MIT License

Adds OAuth-based Single Sign-On (SSO) authentication to the Winter CMS backend using Laravel Socialite. Allow your backend users to authenticate using their existing accounts from providers like Google, GitHub, Microsoft 365, and more.

Features

Installation

Install via Composer:

If using a public folder, republish assets:

Quick Start

Let's set up GitHub authentication as an example:

1. Create OAuth App on GitHub

  1. Go to GitHub Developer Settings
  2. Click "New OAuth App"
  3. Fill in the details:
    • Application name: Your Site Name
    • Homepage URL: https://example.com
    • Authorization callback URL: https://example.com/backend/winter/sso/handle/callback/github
  4. Save and copy your Client ID and Client Secret

2. Configure Environment Variables

Add to your .env file:

3. Enable the Provider

Edit config/winter/sso/config.php (create if it doesn't exist):

4. Test

Visit /backend/auth/signin - you'll see a "Sign in with GitHub" button!

Configuration Reference

Configuration file: config/winter/sso/config.php

Core Settings

Redirect URL Format

All providers use this URL pattern:

Examples:

Built-in Providers

These providers are supported out of the box by Laravel Socialite:

Provider Config Key Setup Guide
Bitbucket bitbucket Bitbucket OAuth
Facebook facebook Facebook Login
GitHub github GitHub OAuth Apps
GitLab gitlab GitLab OAuth
Google google Setup Guide
LinkedIn (OpenID) linkedin-openid LinkedIn OAuth
Twitter (OAuth 1.0) twitter Twitter OAuth
Twitter (OAuth 2.0) twitter-oauth-2 Twitter OAuth 2.0

Adding Additional Providers

Option 1: Provider Plugins (Recommended)

Provider plugins package everything needed for a specific provider:

Provider plugins automatically:

See Creating Provider Plugins for building your own.

Option 2: Direct Socialite Providers

Use any provider from SocialiteProviders.com:

  1. Install the provider package:

  2. Register the provider in your plugin's boot() method:

  3. Add configuration:

  4. Add provider logo (optional): Place an SVG at /plugins/winter/sso/assets/images/providers/microsoft.svg

Events System

The plugin fires events at every stage of the authentication flow, allowing you to customize behavior:

Available Events

Each event is provider-specific. Replace {provider} with your provider name (e.g., google, github).

1. winter.sso.{provider}.authenticating

Fires before OAuth authentication begins. Return false to abort.

2. winter.sso.{provider}.authenticated

Fires after successful OAuth, before user lookup.

3. winter.sso.{provider}.beforeRegister

Fires before creating a new user account. Throw exception to prevent registration.

4. winter.sso.{provider}.registered

Fires after new user is created. Populate additional fields here.

5. winter.sso.{provider}.beforeLogin

Fires before session is created.

6. winter.sso.{provider}.afterLogin

Fires after successful login and session creation.

Accessing SSO Data

User SSO data is stored in the user's metadata:

Metadata structure: Backend\Models\User::metadata['winter.sso'][$provider][$key]

Security Features

SSO ID Verification

Once a user connects via a provider, their SSO ID is stored. On subsequent logins, the ID must match. This prevents account takeover if someone else registers the same email with a different provider.

Email Normalization

Emails are normalized to prevent duplicate accounts:

IP Logging

All authentication attempts are logged with:

View logs: Settings → Logs → SSO Logs

Session Security

The plugin automatically adjusts session.same_site from strict to lax when secure sessions are enabled, ensuring OAuth callbacks work correctly.

Troubleshooting

"The provider X is not enabled"

Cause: Provider not in enabled_providers array.

Solution: Add provider to config:

"Invalid state"

Cause: Session lost between redirect and callback, or CSRF protection too strict.

Solutions:

"Email not found"

Cause: User doesn't exist and allow_registration is false.

Solution: Either:

"Invalid SSO ID"

Cause: User previously connected with a different account from the same provider.

Solution: This is a security feature. The user must use the original account, or an admin must clear the SSO data:

SSO buttons not appearing

Checklist:

  1. Provider is in enabled_providers array
  2. client_id is set in provider config
  3. Environment variables are loaded correctly
  4. Assets are published (php artisan winter:mirror)

Provider-specific issues

Check the provider's setup guide in docs/providers/ for common issues.

Advanced Topics

Preventing Native Authentication

Force SSO-only login:

This will:

If only one provider is enabled, users are redirected directly to that provider.

Customizing Button Appearance

Override button configuration per provider:

Provider Scopes

Request additional OAuth scopes:

HTTP Client Options (Guzzle)

Configure HTTP client for providers behind proxies or with special requirements:

Further Documentation

Contributing

Contributions are welcome! Please submit pull requests to the Winter CMS repository.

License

This plugin is licensed under the MIT License.


All versions of wn-sso-plugin with dependencies

PHP Build Version
Package Version
Requires winter/wn-backend-module Version ^1.2.8 || dev-develop
laravel/socialite Version ~5.3
socialiteproviders/manager Version ^4.0
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 winter/wn-sso-plugin contains the following files

Loading the files please wait ...