PHPackages                             studiokaa/amoclient - 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. studiokaa/amoclient

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

studiokaa/amoclient
===================

Client for amologin

v3.3.0(2y ago)15642CC-BY-NC-SA-4.0PHP

Since Oct 21Pushed 2y agoCompare

[ Source](https://github.com/StudioKaa/amoclient)[ Packagist](https://packagist.org/packages/studiokaa/amoclient)[ RSS](/packages/studiokaa-amoclient/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (9)Dependencies (2)Versions (31)Used By (0)

Amoclient
=========

[](#amoclient)

A Laravel 5 (and up) package for use with the *amologin* OpenID connect server. Now using curio.codes!

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

[](#installation)

**!!** Please make sure your app is using *https*, to prevent unwanted exposure of token, secrets, etc.

To use amoclient in your project:

1. In your laravel project run: `composer require studiokaa/amoclient`
2. Set these keys in your .env file:

    - `AMO_CLIENT_ID`
    - `AMO_CLIENT_SECRET`
    - `AMO_API_LOG` *(optional)*
        - *Default:* `no`
        - Set to `yes` to make Amoclient log all usage of access\_tokens and refresh\_tokens to the default log-channel.
    - `AMO_APP_FOR` *(optional)*
        - *Default:* `teachers`
        - This key determines if students can login to your application.
        - May be one of:
            - `all`: everyone can login, you may restrict access using guards or middleware.
            - `teachers`: a student will be completely blocked and no user will be created when they try to login.
    - `AMO_USE_MIGRATION` *(optional)*
        - *Default:* `yes`
        - Set to no if you want to use your own migration instead of the users migration this package provides
    - `AMO_SSL_VERIFYPEER` *(optional)*
        - *Default:* `yes`
        - Set to `no` if you want to disable SSL verification. This is only recommended for during development and only on trusted networks.
3. Alter your User model and add the line: `public $incrementing = false;`
4. *(Recommended)* Remove any default users-migration from your app, because Amoclient will conflict with it. Do *not* remove the user-model. If you want to keep using your own migration, in your .env file set: `AMO_USE_MIGRATION=no`
5. Lastly, run `php artisan migrate`.

Usage
-----

[](#usage)

### Logging in

[](#logging-in)

Redirect your users to `http://yoursite/amoclient/redirect`, this will send your user to *amologin* for authentication.

You should have a named route that will serve your users with a button or direct redirect to `/amoclient/redirect.`

Example;

```
Route::get('/login', function(){
	return redirect('/amoclient/redirect');
})->name('login');

```

### Catch the after-login redirect

[](#catch-the-after-login-redirect)

After a succesfull login, Amoclient will redirect you to `/amoclient/ready`. You may define a route in your applications `routes/web.php` file to handle this.

Example;

```
Route::get('/amoclient/ready', function(){
	return redirect('/educations');
})

```

### Logging out

[](#logging-out)

Send your user to `/amoclient/logout`. *Please note:* a real logout cannot be accomplished at this time. If you log-out of your app, but are still logged-in to the *amologin*-server, this will have no effect.

### Laravel's `make:auth`

[](#laravels-makeauth)

Don't use this in combination with Amoclient.

AmoAPI
------

[](#amoapi)

Apart from being the central login-server, *login.amo.rocks* also exposes an api. Please note this api is currently undocumented, although there are options to explore the api:

- Refer to *amologin*'s [routes/api.php](https://github.com/StudioKaa/amologin/blob/master/routes/api.php) file.
- Play around at [apitest.amo.rocks](https://apitest.amo.rocks/).

### Amoclient API Interface

[](#amoclient-api-interface)

An example of calling the api through Amoclient;

```
namespace App\Http\Controllers;
use \StudioKaa\Amoclient\Facades\AmoAPI;

class MyController extends Controller
{
	//This method is protected by the auth-middleware
	public function index()
	{
		 $users = AmoAPI::get('users');
		 return view('users.index')->with(compact('users'));
	}
}

```

**Known 'bug':** Currently the AmoAPI class doesn't check if the token expired but just refreshes it anytime you use it.

### `AmoAPI::get($endpoint)`

[](#amoapigetendpoint)

- Performs an HTTP-request like `GET https://api.amo.rocks/$endpoint`.
- This method relies on a user being authenticated through the amoclient first. Please do call this method only from routes and/or controllers protected by the *auth* middlware.
- Returns a Laravel-collection

Contributing
------------

[](#contributing)

1. Clone this repository to your device
2. Inside the root of this repository run `composer install`
3. Create a test project in which you will use this package (Follow [Usage](#usage) instructions above)
4. Add the package locally using the following additions to your composer.json: ```
    	"repositories": [
    		{
    			"type": "path",
    			"url": "../amoclient"
    		}
    	],
    ```

    - **Note:** `../amoclient` should point to where you cloned this package
5. Run `composer require "studiokaa/amoclient @dev"` inside the test project

You can now test and modify this package. Changes will immediately be reflected in the test project.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 83.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

Every ~77 days

Recently: every ~278 days

Total

30

Last Release

880d ago

Major Versions

v1.5.1 → v2.0.02020-10-24

v2.0.4 → v3.0.02020-11-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/04de748c9b2a35fe4ab54197718ac42c180fb4c250c2b2c35c5a91b917dd66d3?d=identicon)[bartjroos](/maintainers/bartjroos)

---

Top Contributors

[![bartjroos](https://avatars.githubusercontent.com/u/28384433?v=4)](https://github.com/bartjroos "bartjroos (50 commits)")[![luttje](https://avatars.githubusercontent.com/u/2738114?v=4)](https://github.com/luttje "luttje (9 commits)")[![Feddman](https://avatars.githubusercontent.com/u/4361792?v=4)](https://github.com/Feddman "Feddman (1 commits)")

### Embed Badge

![Health badge](/badges/studiokaa-amoclient/health.svg)

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

###  Alternatives

[vonage/jwt

A standalone package for creating JWTs for Vonage APIs

424.1M4](/packages/vonage-jwt)[scheb/2fa-trusted-device

Extends scheb/2fa-bundle with trusted devices support

355.1M16](/packages/scheb-2fa-trusted-device)[simplesamlphp/simplesamlphp-module-oidc

A SimpleSAMLphp module adding support for the OpenID Connect protocol

5016.9k1](/packages/simplesamlphp-simplesamlphp-module-oidc)[nl.idaas/openid-server

OpenID Connect server for PHP

47129.2k1](/packages/nlidaas-openid-server)[descope/descope-php

Descope SDK for PHP

3814.0k](/packages/descope-descope-php)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)

PHPackages © 2026

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