Download the PHP package users-au/users-au-laravel-client without Composer

On this page you can find all versions of the php package users-au/users-au-laravel-client. 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 users-au-laravel-client

Users.au OAuth Laravel Client

Latest Stable Version Total Downloads Tests

Table of Contents

Introduction

This package provides a seamless Laravel integration for Users.au OAuth authentication. It simplifies the process of implementing Users.au single sign-on (SSO) in your Laravel applications, handling authentication, user management, and session control.

Features

Requirements

Installation

Install the package via Composer:

Publish the package assets:

Run the migrations to add required columns to your users table:

Configuration

1. Update Your User Model

Add the following fields to your User model's fillable and hidden arrays:

2. Service Configuration

Add Users.au configuration to your config/services.php:

3. Environment Variables

Set the following environment variables in your .env file:

4. Package Configuration

The package publishes a configuration file at config/usersau.php. You can customize:

5. Manual Service Provider Registration (Optional)

If auto-discovery is disabled, manually register the service provider in config/app.php:

Usage

Authentication Routes

The package automatically registers the following routes:

Route Name Description
GET /auth/usersau/redirect usersau.login Initiates OAuth flow
GET /auth/usersau/callback - OAuth callback handler
GET /auth/usersau/logout usersau.logout Logout and redirect to Users.au
GET /auth/usersau/register usersau.register Redirect to Users.au registration
GET /auth/usersau/account usersau.account Redirect to Users.au account page

Basic Usage Examples

Login Link

Logout Link

Registration Link

Account Management Link

Middleware Protection

Protect your routes using Laravel's built-in auth middleware:

Custom User Handling

You can listen for authentication events to perform custom actions:

API Reference

AuthController Methods

The AuthController provides the following public methods:

redirect()

Initiates the OAuth flow by redirecting to Users.au.

callback()

Handles the OAuth callback, creates/updates user records, and logs in the user.

Process:

  1. Retrieves user data from Users.au
  2. Creates or updates local user record
  3. Syncs profile photo (if configured)
  4. Logs in the user
  5. Redirects to configured URL

logout()

Logs out the user locally and redirects to Users.au logout.

account()

Redirects authenticated users to their Users.au account page.

register()

Redirects to Users.au registration page.

Configuration Options

Option Type Default Description
after_login_url string '/' URL to redirect after login
after_logout_url string '/' URL to redirect after logout
after_register_url string '/' URL to redirect after registration
user_model string App\Models\User::class User model class
middleware array ['web'] Middleware for auth routes
profile_photo_column string null null Database column for profile photos

Migration Guide

From Version 1.x to 2.x

If you're upgrading from an older version:

  1. Update your composer requirements
  2. Run php artisan vendor:publish --provider="Usersau\UsersauLaravelClient\UsersauLaravelClientServiceProvider" --force
  3. Run php artisan migrate
  4. Update your environment variables if needed

Troubleshooting

Common Issues

"Invalid State Exception"

This usually occurs when the OAuth state parameter doesn't match. Common causes:

Solution: Ensure your session driver is properly configured and cookies are enabled.

"Client Exception during OAuth"

This indicates communication issues with Users.au servers.

Solutions:

"User Model Not Found"

The configured user model doesn't exist.

Solution: Verify the user_model in config/usersau.php points to your correct User model.

Migration Errors

Issues running the package migrations.

Solutions:

Debug Mode

Enable debug mode in your .env for detailed error messages:

Support

For additional support:

Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

Development Setup

  1. Clone the repository
  2. Install dependencies: composer install
  3. Run tests: composer test
  4. Follow PSR-12 coding standards

Testing

Run the test suite:

For coverage reports:

Changelog

Please see CHANGELOG.md for more information on what has changed recently.

License

The MIT License (MIT). Please see LICENSE.md for more information.


All versions of users-au-laravel-client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
users-au/socialite-provider Version ^1.1
illuminate/support Version ^5.0|^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/routing Version ^5.0|^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/contracts Version ^5.0|^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/database Version ^5.0|^6.0|^7.0|^8.0|^9.0|^10.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 users-au/users-au-laravel-client contains the following files

Loading the files please wait ....