PHPackages                             uniguide/pportalen-laravel-gw - 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. uniguide/pportalen-laravel-gw

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

uniguide/pportalen-laravel-gw
=============================

A wrapper for Pportalen auth and resource API

1.1.4(1y ago)0465MITPHPPHP &gt;=7.1|^8.1

Since Aug 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Uniguide-AB/pportalen-laravel-gw)[ Packagist](https://packagist.org/packages/uniguide/pportalen-laravel-gw)[ RSS](/packages/uniguide-pportalen-laravel-gw/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (2)Versions (8)Used By (0)

Pre-reqs
--------

[](#pre-reqs)

- at least PHP 7.1
- at least Laravel 5.8

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

[](#installation)

1. install with composer `composer require uniguide/pportalen-laravel-gw`
2. Edit `config\services.php`

```
    'pportalen' => [
        'endpoint' => env('PPORTALEN_ENDPOINT', 'https://api.personal.uniguide.se/v1/'),
        'app_id' => env('PPORTALEN_APP_ID'), // public
        'access_token' => env('PPORTALEN_ACCESS_TOKEN'), // secret
    ]
```

3. Add these to `.env`

```
PPORTALEN_APP_ID=XXXXX
PPORTALEN_ACCESS_TOKEN=YYYYY

```

Authentication flow
-------------------

[](#authentication-flow)

1. Non authenticated users should be redirected to `https://personal.uniguide.se/login?app=`
2. After a succesful login a GET request is made to `https://?tmpToken=`
3. The callback endpoint can resolve `Gateway::resolveToken('')` for a short period of time

### Example implementation

[](#example-implementation)

```
