PHPackages                             users-au/socialite-provider - 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. users-au/socialite-provider

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

users-au/socialite-provider
===========================

Users.au OAuth2 Provider for Laravel Socialite

1.1.1(1y ago)02092MITPHPPHP ^7.4 || ^8.0CI passing

Since Sep 10Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/Users-au/socialite-provider)[ Packagist](https://packagist.org/packages/users-au/socialite-provider)[ RSS](/packages/users-au-socialite-provider/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (2)

Users.au OAuth2 Provider for Laravel Socialite
==============================================

[](#usersau-oauth2-provider-for-laravel-socialite)

[![Latest Version on Packagist](https://camo.githubusercontent.com/530ae8ff0fab399ba5f61cdfbf03fac68aa3ee9c44fa18e46db8cf31866433c1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f75736572732d61752f736f6369616c6974652d70726f76696465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/users-au/socialite-provider)[![Total Downloads](https://camo.githubusercontent.com/59cd74ab1f55e1ce2a2925426159b17b11db172aca6676980396e766c59167cf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f75736572732d61752f736f6369616c6974652d70726f76696465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/users-au/socialite-provider)[![Tests](https://camo.githubusercontent.com/f218cde2616f6bc970a6dcdf88e924f4bbaeb9370bd31b1395cd2facd04619c9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f75736572732d61752f736f6369616c6974652d70726f76696465722f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/users-au/socialite-provider/actions/workflows/tests.yml)[![PHP Version Require](https://camo.githubusercontent.com/23f750f8e31dd7dad7957a4566882d27f7d4833fea610b1d6438e8caa1f31e45/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f75736572732d61752f736f6369616c6974652d70726f76696465723f7374796c653d666c61742d737175617265)](https://packagist.org/packages/users-au/socialite-provider)[![License](https://camo.githubusercontent.com/71195994e1f3c5ee675181d2e26db8b9856170366926e42e065518517dfe814e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f75736572732d61752f736f6369616c6974652d70726f76696465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/users-au/socialite-provider)

A Laravel Socialite OAuth2 provider for Users.au authentication service. This package allows you to easily integrate Users.au OAuth2 authentication into your Laravel applications using the Socialite package.

Overview
--------

[](#overview)

This package provides:

- **OAuth2 Authentication**: Seamless integration with Users.au OAuth2 service
- **Flexible Configuration**: Configurable endpoints and user field mappings
- **Standard Socialite Interface**: Uses Laravel Socialite's familiar API
- **Customizable User Mapping**: Map Users.au user data to your application's user model

### Features

[](#features)

- Support for OAuth2 authorization code flow
- Configurable host and endpoint URLs
- Custom user field mapping (id, nickname, name, email, avatar)
- Bearer token authentication for API requests
- Compatible with Laravel Socialite Manager

### How it Works

[](#how-it-works)

1. **OAuth2 Flow**: Implements the standard OAuth2 authorization code flow
2. **User Authentication**: Redirects users to Users.au for authentication
3. **Token Exchange**: Exchanges authorization code for access token
4. **User Data Retrieval**: Fetches user information using the access token
5. **User Mapping**: Maps Users.au user data to Laravel Socialite User object

API Endpoints
-------------

[](#api-endpoints)

The Provider makes calls to three main Users.au OAuth2 endpoints:

### 1. Authorization Endpoint

[](#1-authorization-endpoint)

**URL**: `GET {host}/oauth/authorize`

**Purpose**: Redirects user to Users.au for authentication

**Query Parameters**:

```
client_id={client_id}
redirect_uri={redirect_uri}
response_type=code
scope={scopes}
state={state}

```

**Response**: Redirects to your `redirect_uri` with authorization code

```
{redirect_uri}?code={authorization_code}&state={state}

```

### 2. Token Endpoint

[](#2-token-endpoint)

**URL**: `POST {host}/oauth/token`

**Purpose**: Exchange authorization code for access token

**Request Headers**:

```
Content-Type: application/x-www-form-urlencoded

```

**Request Payload**:

```
grant_type=authorization_code
client_id={client_id}
client_secret={client_secret}
code={authorization_code}
redirect_uri={redirect_uri}

```

**Expected Response**:

```
{
  "access_token": "your_access_token",
  "token_type": "Bearer",
  "expires_in": 3600,
  "refresh_token": "your_refresh_token",
  "scope": "..."
}
```

### 3. User Info Endpoint

[](#3-user-info-endpoint)

**URL**: `GET {host}/api/user`

**Purpose**: Retrieve authenticated user's information

**Request Headers**:

```
Authorization: Bearer {access_token}

```

**Expected Response**:

```
{
  "id": "user_unique_id",
  "nickname": "user_nickname",
  "name": "User Full Name",
  "email": "user@example.com",
  "avatar": "https://example.com/avatar.jpg"
}
```

**Note**: The user data structure can be customized using the `userinfo_key` configuration and custom field mappings (`user_id`, `user_nickname`, `user_name`, `user_email`, `user_avatar`).

Installation
------------

[](#installation)

```
composer require users-au/socialite-provider
```

Installation &amp; Basic Usage
------------------------------

[](#installation--basic-usage)

Please see the [Base Installation Guide](https://socialiteproviders.com/usage/), then follow the provider specific instructions below.

### Add configuration to `config/services.php`

[](#add-configuration-to-configservicesphp)

```
'usersau' => [
  'client_id' => env('USERSAU_CLIENT_ID'),
  'client_secret' => env('USERSAU_CLIENT_SECRET'),
  'redirect' => env('USERSAU_REDIRECT_URI'),
  'host' => env('USERSAU_HOST'),
],
```

### Add provider event listener

[](#add-provider-event-listener)

Configure the package's listener to listen for `SocialiteWasCalled` events.

Add the event to your `listen[]` array in `app/Providers/EventServiceProvider`. See the [Base Installation Guide](https://socialiteproviders.com/usage/) for detailed instructions.

```
protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
        \SocialiteProviders\UsersAu\UsersauExtendSocialite::class.'@handle',
    ],
];
```

### Usage

[](#usage)

You should now be able to use the provider like you would regularly use Socialite (assuming you have the facade installed):

```
return Socialite::driver('usersau')->redirect();
```

### Returned User fields

[](#returned-user-fields)

- `id`
- `nickname`
- `name`
- `email`
- `avatar`

Testing
-------

[](#testing)

This package includes comprehensive unit tests to ensure reliability and maintainability.

### Running Tests

[](#running-tests)

To run the test suite:

```
# Install dependencies
composer install

# Run all tests
composer test

# Or run PHPUnit directly
./vendor/bin/phpunit

# Run tests with documentation format
./vendor/bin/phpunit --testdox

# Run static analysis
composer analyse

# Run both tests and analysis
composer check
```

### Continuous Integration

[](#continuous-integration)

This package uses GitHub Actions for continuous integration with the following workflows:

- **Tests**: Runs unit tests across PHP 7.4, 8.0, 8.1, 8.2, and 8.3
- **Static Analysis**: Runs PHPStan for type checking and code quality
- **Code Style**: Validates PHP syntax and PSR-4 compliance

All workflows run automatically on:

- Push to `main` or `master` branches
- Pull requests to `main` or `master` branches

### Test Structure

[](#test-structure)

```
tests/
├── ProviderTest.php           # Main provider functionality tests
└── UsersauExtendSocialiteTest.php  # Extension registration tests

```

The tests use PHPUnit and Mockery for mocking dependencies, ensuring isolated unit tests without external dependencies.

Development
-----------

[](#development)

### Requirements

[](#requirements)

- PHP 7.4 or higher
- Composer
- PHPUnit (for testing)

### Contributing

[](#contributing)

1. Fork the repository
2. Create a feature branch
3. Add tests for new functionality
4. Ensure all tests pass
5. Submit a pull request

### Code Quality

[](#code-quality)

This package follows PSR-4 autoloading standards and includes:

- Comprehensive unit tests
- Type hints and return types
- Proper error handling
- Documentation for all public methods

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance49

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

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

Every ~289 days

Total

3

Last Release

395d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e2951851fcef464f5f5745cac87603ddd3675ba9f92623c5156a6073e499e28?d=identicon)[sicaboy](/maintainers/sicaboy)

---

Top Contributors

[![sicaboy](https://avatars.githubusercontent.com/u/2426114?v=4)](https://github.com/sicaboy "sicaboy (11 commits)")

---

Tags

laravelprovideroauthsocialiteusers.au

### Embed Badge

![Health badge](/badges/users-au-socialite-provider/health.svg)

```
[![Health](https://phpackages.com/badges/users-au-socialite-provider/health.svg)](https://phpackages.com/packages/users-au-socialite-provider)
```

###  Alternatives

[socialiteproviders/microsoft

Microsoft OAuth2 Provider for Laravel Socialite

326.1M13](/packages/socialiteproviders-microsoft)[socialiteproviders/instagram

Instagram OAuth2 Provider for Laravel Socialite

421.9M5](/packages/socialiteproviders-instagram)[kovah/laravel-socialite-oidc

OpenID Connect OAuth2 Provider for Laravel Socialite

2073.7k](/packages/kovah-laravel-socialite-oidc)[socialiteproviders/kakao

Kakao OAuth2 Provider for Laravel Socialite

10484.7k4](/packages/socialiteproviders-kakao)

PHPackages © 2026

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