PHPackages                             socialiteproviders/imis - 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. socialiteproviders/imis

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

socialiteproviders/imis
=======================

IMIS OAuth2 Provider for Laravel Socialite

5.0.0(3y ago)12.1kMITPHPPHP ^7.4 || ^8.0

Since Jul 26Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/SocialiteProviders/Imis)[ Packagist](https://packagist.org/packages/socialiteproviders/imis)[ RSS](/packages/socialiteproviders-imis/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

IMIS
====

[](#imis)

[Imis.com](https://imis.com)

```
composer require socialiteproviders/imis
```

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)

```
'imis' => [
    'host' => env('IMIS_HOST'),
    'login_url' => env('IMIS_LOGIN_URL'),
    'client_id' => env('IMIS_CLIENT_ID'),
    'client_secret' => env('IMIS_CLIENT_SECRET'),
    'redirect' => env('IMIS_CALLBACK_URL'),
],
```

### Add provider event listener

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

#### Laravel 11+

[](#laravel-11)

In Laravel 11, the default `EventServiceProvider` provider was removed. Instead, add the listener using the `listen` method on the `Event` facade, in your `AppServiceProvider` `boot` method.

- Note: You do not need to add anything for the built-in socialite providers unless you override them with your own providers.

```
Event::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) {
    $event->extendSocialite('imis', \SocialiteProviders\Imis\Provider::class);
});
```

Laravel 10 or below 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\Imis\ImisExtendSocialite::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('imis')->redirect();
```

Example env

```
IMIS_HOST=https://www.public-imis-site.com
IMIS_LOGIN_URL=Web/Sign-in.aspx
IMIS_CLIENT_ID=MySSOApp
IMIS_CLIENT_SECRET=
IMIS_CALLBACK_URL=https://example-laravel-site.com/oauth2/imis/callback
```

---

### Creating the IMIS UserInfo Query

[](#creating-the-imis-userinfo-query)

Create directory in root: 'OAuth2' and create query inside this directory.

Define &gt; Summary Tab

- Name: userInfo
- Description:

    SSO user Info Built to OAuth2 Standards [https://openid.net/specs/openid-connect-core-1\_0.html#StandardClaims](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims)

Define &gt; Sources Tab

- Sources: UserData + PartyData
- Relations: Custom (When UserData.Party Id = PartyData.Party Id)

Define &gt; Filters

- Property: Where PartyData.Party Id
- Function: None
- Comparison: Equal
- Value: Dynamic
- LoggedInUserKey
- Prompt: No
- Limit number of results to 1

Define &gt; Display

- PartyData.Party Id - Alias 'sub'
- UserData.Username - Alias 'username'
- UserData.Email - Alias 'email'
- PartyData.First Name - Alias 'given\_name'
- PartyData.Last Name - Alias 'family\_name'

Response

```
https://{{URL}}/api/query?QueryName=$/OAuth2/userInfo
```

```
{
    "$type": "Asi.Soa.Core.DataContracts.PagedResult, Asi.Contracts",
    "Items": {
        "$type": "System.Collections.Generic.List`1[[System.Object, mscorlib]], mscorlib",
        "$values": [
            {
                "$type": "System.Dynamic.ExpandoObject, System.Core",
                "sub": "123456aa-UUID-0000-0000-000000000000",
                "username": "EXAMPLE@EXAMPLE.COM.AU",
                "email": "example@example.com",
                "given_name": "First",
                "family_name": "Last"
            }
        ]
    },
    "Offset": 0,
    "Limit": 100,
    "Count": 1,
    "TotalCount": 1,
    "NextPageLink": null,
    "HasNext": false,
    "NextOffset": 0
}
```

---

#### Helpful tips

[](#helpful-tips)

- [SSO Setup Info](https://blog.jamessiebert.com/laravel-socialite-imis-tutorial/)
- [Migrating from IQA to Query Service](https://developer.imis.com/docs/migrating-from-iqa-to-query-service-endpoint)
- In IMIS use the same name for the Client ID and the SSO content item
- A custom query needs to be created to return the user info, userInfo endpoints are not supported by Imis
- Imis returns a 'refresh\_token' instead of the auth code so the provider has been modified to handle this.
- Imis does return values when a user is not logged in. The refresh\_token and bearer token relate to a Guest user. As the guest user has no user attributes, we should not allow this in our laravel app. This is how I handle this:

    ```
    // -- When handling a POST to the callback url

        public function oauthHandleCallback(Request $request, String $provider): RedirectResponse
        {
            switch ($provider) {

                case "imis":

                        // Copy 'refresh_token' to a 'code' for use in Socialite
                        $request->request->add(['code' => $request->post('refresh_token')]);

                        // Fails if user is a guest
                        try {
                            $user = Socialite::driver('imis')->stateless()->user();
                        }
                        catch(\Throwable $e) {
                            // Redirect to Imis login
                            return redirect()->away(config('services.imis.host').'/'.config('services.imis.login_url'));
                        }
                    break;

                default:
                    dd('provider fail not found');
            }

            $authUser = $this->findOrCreateUser($user, $provider);

            Auth::login($authUser, true);

            return redirect(config('app.url').'/member');
        }
    ```

[project setup tutorial](https://blog.jamessiebert.com/laravel-socialite-imis-tutorial)

### Returned User fields

[](#returned-user-fields)

- `id`
- `nickname`
- `name`
- `email`
- `avatar`
- `user[]`

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance52

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.3% 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

Unknown

Total

1

Last Release

1438d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/65eb3a7ba2a2c13b3a9de48b836caf759ad4052f9a839e30464c80d177d5b3d2?d=identicon)[atymic](/maintainers/atymic)

---

Top Contributors

[![lucasmichot](https://avatars.githubusercontent.com/u/513603?v=4)](https://github.com/lucasmichot "lucasmichot (9 commits)")[![atymic](https://avatars.githubusercontent.com/u/50683531?v=4)](https://github.com/atymic "atymic (3 commits)")[![JamesSiebert](https://avatars.githubusercontent.com/u/40009834?v=4)](https://github.com/JamesSiebert "JamesSiebert (1 commits)")[![maks-oleksyuk](https://avatars.githubusercontent.com/u/90793591?v=4)](https://github.com/maks-oleksyuk "maks-oleksyuk (1 commits)")

---

Tags

laraveloauthoauth1oauth2social-mediasocialitesocialite-providerslaravelprovideroauthsocialiteimis

### Embed Badge

![Health badge](/badges/socialiteproviders-imis/health.svg)

```
[![Health](https://phpackages.com/badges/socialiteproviders-imis/health.svg)](https://phpackages.com/packages/socialiteproviders-imis)
```

###  Alternatives

[socialiteproviders/apple

Apple OAuth2 Provider for Laravel Socialite

629.5M14](/packages/socialiteproviders-apple)[socialiteproviders/microsoft

Microsoft OAuth2 Provider for Laravel Socialite

347.3M23](/packages/socialiteproviders-microsoft)[socialiteproviders/instagram

Instagram OAuth2 Provider for Laravel Socialite

402.0M5](/packages/socialiteproviders-instagram)[socialiteproviders/saml2

SAML2 Service Provider for Laravel Socialite

172.6M4](/packages/socialiteproviders-saml2)[kovah/laravel-socialite-oidc

OpenID Connect OAuth2 Provider for Laravel Socialite

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

Kakao OAuth2 Provider for Laravel Socialite

10510.1k5](/packages/socialiteproviders-kakao)

PHPackages © 2026

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