impressolabs / laravel-sign-in-with-huawei
Add Huawei's new single-signon feature to your site with ease.
Installs: 2 328
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 4
Open Issues: 0
Requires
- php: >=7.3
- illuminate/support: ^8.0
- laravel/socialite: ^5.0
Requires (Dev)
- orchestra/testbench: ^6.0
- orchestra/testbench-browser-kit: ^6.0
- orchestra/testbench-dusk: ^6.0
- phpunit/phpunit: ^9.3
- predis/predis: ^1.1
This package is auto-updated.
Last update: 2024-04-19 06:49:55 UTC
README
Supporting This Package
Code base fork from https://github.com/GeneaLabs/laravel-sign-in-with-apple
This is an MIT-licensed open source project with its ongoing development made possible by the support of the community. If you'd like to support this, and our other packages, please consider sponsoring us via the button above.
https://medium.com/@starkliew/how-to-sign-in-using-huawei-id-with-laravel-336a2397b930
Table of Contents
Requirements
- PHP 7.2+
- Laravel 7+
- Socialite 4.2+
- Huawei Developer Account
Installation
- Install the composer package:
composer require impressolabs/laravel-sign-in-with-huawei
Configuration
Implementation
<?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use Laravel\Socialite\Facades\Socialite; class HuaweiSigninController extends Controller { public function __construct() { $this->middleware('guest')->except('logout'); } public function login() { return Socialite::driver("huawei") ->redirect(); } public function callback(Request $request) { // get abstract user object, not persisted $user = Socialite::driver("huawei") ->user(); } }
Credits
- https://github.com/GeneaLabs/laravel-sign-in-with-apple
- https://developer.huawei.com/consumer/en/doc/development/HMS-References/account-obtain-token
- https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201272938220820099&fid=0101187876626530001
- https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References-V1/scope-0000001050728398-V1