weigreen/ncuportal

ncu portal library

1.0.0 2015-04-08 11:32 UTC

This package is not auto-updated.

Last update: 2024-04-27 14:59:24 UTC


README

NCUPortal is a library providing an easier and expressive way to use NCU Portal to let users login to your application.

Requirements

  • PHP >=5.4

Installation

Add this to your composer.json.

"require": {
  "weigreen/ncuportal": "v1.0.0"
}

Examples

First phase (create url to redirect user to ncu portal)

// Set up NCUPortal with your application's domain
$ncuPortal = new NCUPortal('your-application-domain');

// Get Auth URL with call back url
$ncuPortal->getAuthUrl('call-back-url');

PS: callback url is used when user login on NCU Portal and will redirect to callback url

Second phase (callback)

// Set up NCUPortal with your application's domain
$ncuPortal = new NCUPortal('your-application-domain');

// Check if callback is validate or not
// One time used. Second call will be false
if($ncuPortal->checkLoginValidate()){
  echo "Login Real";
  // get login account
  echo $ncuPortal->getLoginAccount();
}else{
  echo "Login is not real >_<";
}

Bug

If you found bugs, please contact me at issue. thanks :)

Links

License

NCUPortal is licensed under the MIT License.