Download the PHP package alisafari-dev/laravel-keycloak-sso without Composer

On this page you can find all versions of the php package alisafari-dev/laravel-keycloak-sso. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-keycloak-sso

Laravel Keycloak SSO

پکیج Laravel برای اتصال Keycloak با Socialite و SocialiteProviders/Keycloak.

مسیرها با prefix ثبت می‌شوند تا با routeهای بقیه سرویس‌ها یا ماژول‌های پروژه تداخل نداشته باشند.

ویژگی‌ها

پیش‌نیازها

نصب

۱. افزودن repository (اگر روی Packagist نیست)

در composer.json پروژه:

۲. نصب پکیج

وابستگی‌های زیر به‌صورت خودکار نصب می‌شوند:

معماری

تنظیم Keycloak

در Clients → Create client (OpenID Connect, confidential):

فیلد مقدار نمونه
Client ID laravel-app
Valid redirect URIs http://your-host/sso/callback
Valid post logout redirect URIs http://your-host/
Root URL http://your-host

نکات:

متغیرهای محیطی

متغیر پیش‌فرض توضیح
KEYCLOAK_BASE_URL آدرس Keycloak بدون /realms/...
KEYCLOAK_REALM master نام realm
KEYCLOAK_CLIENT_ID Client ID
KEYCLOAK_CLIENT_SECRET Secret کلاینت confidential
KEYCLOAK_REDIRECT_URI باید با callback در Keycloak یکی باشد
KEYCLOAK_POST_LOGOUT_REDIRECT_URI URI بازگشت بعد از logout
KEYCLOAK_SSO_ROUTE_PREFIX sso prefix مسیرها
KEYCLOAK_SSO_USER_IDENTIFIER_COLUMN personal_id ستون شناسه در جدول users
KEYCLOAK_SSO_USER_IDENTIFIER_CLAIM employeeID claim در پاسخ Keycloak
KEYCLOAK_SSO_REDIRECT_AFTER_LOGIN dashboard route name بعد از login
KEYCLOAK_SSO_PLACEHOLDER_EMAIL_DOMAIN sso.local دامنه ایمیل موقت اگر email نباشد

مسیرها

پیش‌فرض با prefix sso:

Method URI Route name
GET /sso/login keycloak-sso.login
GET /sso/auth/keycloak keycloak-sso.redirect
GET /sso/callback keycloak-sso.callback
POST /sso/logout keycloak-sso.logout

برای تغییر prefix:

آنگاه callback می‌شود: /auth/sso/callback — همان را در Keycloak ثبت کنید.

یکپارچه‌سازی با پروژه

۱. مدل User

ستون شناسه (از migration پکیج) و fillable:

۲. redirect مهمان‌ها

در bootstrap/app.php:

۳. دکمه خروج

۴. (اختیاری) alias برای /login

اگر Breeze یا لینک‌های قدیمی route('login') دارند:

سفارشی‌سازی

publish view

فایل‌ها در resources/views/vendor/keycloak-sso/ قرار می‌گیرند.

تغییر claim شناسه

اگر به‌جای employeeID از claim دیگری استفاده می‌کنید:

تغییر مدل User

رفع مشکل

Invalid redirect uri در login

Invalid redirect uri در logout

شناسه کاربر در اطلاعات Keycloak یافت نشد

NOT NULL constraint failed: users.email

License

MIT


All versions of laravel-keycloak-sso with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/support Version ^11.0|^12.0|^13.0
laravel/socialite Version ^5.27
socialiteproviders/keycloak Version ^5.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package alisafari-dev/laravel-keycloak-sso contains the following files

Loading the files please wait ...