NCU portal login
NCUPortal is a library providing an easier and expressive way to use NCU Portal to let users login to your application., (*1)
Requirements
Installation
Add this to your composer.json., (*2)
"require": {
"weigreen/ncuportal": "v1.0.0"
}
Examples
First phase (create url to redirect user to ncu portal), (*3)
// 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, (*4)
Second phase (callback), (*5)
// 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 :), (*6)
Links
License
NCUPortal is licensed under the MIT License., (*7)