shalvah / unnportal-api
Authenticate and get details about your users as UNN students
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/shalvah/unnportal-api
Requires
- php: >=5.3.3
- ext-curl: *
This package is auto-updated.
Last update: 2025-10-12 07:34:00 UTC
README
unnportal-php
PHP library for the UNN API
  
 
Authenticate and get details about your application's users through their unnportal details. With this, you can restrict your app's audience to the right people.
Usage:
<?php
use \UnnPortal\Portal;
use \UnnPortal\PortalException;
require 'vendor/autoload.php';
$username = "2013/1xxxxx";
$password = "xxxxxx";
try {
    $student = Portal::authenticate($username, $password);
    echo "Hi there, $student->first_name from the department of $student->department!";
} catch (PortalException $e) {
    echo $e->getMessage();
}
The authenticate method returns an instance of \UnnPortal\Student if successful, or throws a PortalException if not.
For a list of available student details, see the documentation at https://github.com/shalvah/unn-api
Installation:
Run composer install shalvah/unnportal-api.
Contribution
Wanna help improve this package? Thanks! All you need to do:
- Fork the project
- Clone your fork to your local machine
- Make your changes
- Commit your changes and push
- Open a pull request I'll attend to all PRs as soon as I can!
If you like this...
Please star and share! Thanks!