About The Project
This library provides some features to connect to Gluu server.
Built With
Installation
composer require diagvn/gluu-php-sdk
php artisan vendor:publish Gluu\Providers\GluuServiceProvider --config
Usage
Authenticate:
public function authenticate(
?string $username,
//Password can be null, if password = null, default password = config('gluu.default_password')
?string $password,
string $grantType,
?string $scope = null
) : ?array
Register user
public function register(
string $username,
//Email can be null, if email = null, default email phoneNumber@gluu.diag.vn
?string $email,
string $phoneNumber,
//Password can be null, if password = null, default password = config('gluu.default_password')
?string $password): mixed
Example:
use Gluu\App\AuthenticationInterface;
class AuthController extends Controller
{
public function __construct(
private AuthenticationInterface $authenticationService,
) {
}
public function index(Request $request)
{
$this->authenticationService->register(
username:$request->username,
email: $request->email,
phoneNumber: $request->phone_number,
password: $request->password
);
$result = $this->authenticationService->authenticate(
username: $request->username,
password: $request->password,
grantType: "password",
scope: "openid"
);
return
}
}
Contributing
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
Bradley Nguyen - giang.nguyen@diag.vn
Travis Au - toan.au@diag.vn
Duc Bui - duc.bui@diag.vn