PHPackages                             sunh-1294/sun-auth-wsm - 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. sunh-1294/sun-auth-wsm

ActiveLibrary

sunh-1294/sun-auth-wsm
======================

Oauth2 with WSM

0684[1 issues](https://github.com/sunh-2087/sun-auth-wsm/issues)PHPCI failing

Since May 20Pushed 5y agoCompare

[ Source](https://github.com/sunh-2087/sun-auth-wsm)[ Packagist](https://packagist.org/packages/sunh-1294/sun-auth-wsm)[ RSS](/packages/sunh-1294-sun-auth-wsm/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

Documentation
-------------

[](#documentation)

To get started with **SunAuth**, use Composer to add the package to your project's dependencies:

```
    composer require sunh-1294/sun-auth-wsm
```

Configuration
-------------

[](#configuration)

### Laravel 5.5+

[](#laravel-55)

Laravel uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

### Laravel &lt; 5.5:

[](#laravel--55)

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

```
'providers' => [
    // Other service providers...

    Sun\Auth\SunAuthServiceProvider::class,
],
```

Also, add the `SunAuth` facade to the `aliases` array in your `app` configuration file:

```
'aliases' => [
    // Other aliases

    'SunAuth' => Sun\Auth\Facades\SunAuth::class,
],
```

You will also need to add credentials for the OAuth services your application utilizes. These credentials should be placed in your `config/services.php` configuration file, and use the key `sun`. For example:

```
'sun' => [
    'client_id' => 'your-sun-auth-app-id',
    'client_secret' => 'your-sun-auth-app-secret',
    'base_url' => 'http://base-url-wsm'
    'redirect' => 'http://your-callback-url',
],
```

### Basic Usage

[](#basic-usage)

Next, you are ready to authenticate users! You will need two routes: one for redirecting the user to the OAuth provider, and another for receiving the callback from the provider after authentication. We will access **Sun Auth** using the `SunAuth` facade:

```
