承接 accentinteractive/laravel-sso 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

accentinteractive/laravel-sso

Composer 安装命令:

composer require accentinteractive/laravel-sso

包简介

Azure AD SSO (Single Sign On) login management for Laravel.

README 文档

README

Latest Version on Packagist Build Status Quality Score Total Downloads

Installation

You can install the package via composer:

Step 1

composer require accentinteractive/laravel-sso

Step 2

Register your application with the Azure portal. You need a valid Microsoft account and the proper authorization for your company. For a full manual, see Registering a new Azure AD application.

Step 3

Once your have registered the application with Azure AD, add the proper credentials to your .env file. Get the proper IDs and secrets from https://portal.azure.com/

SSO_ENABLED=true

# App Registrations › Application › Application (client) ID
SSO_CLIENT_ID="YOUR_CLIENT_ID_HERE"

# App Registrations › Application › Directory (tenant) ID
SSO_TENANT_ID="YOUR_TENANT_ID_HERE"

# App Registrations › Application › Client credentials › New client secret
SSO_CLIENT_SECRET="YOUR_CLIENT_SECRET_HERE"

# App Registrations › Application › Redirect URIs (platform 'Web')
SSO_CLIENT_REDIRECT_URL="https://YOURDOMAIN.COM/login"

SSO_AUTH_TENANT=common

Step 4

Add the middleware to your 'web' middleware group to place all endpoints behind SSO, or to another group if you want to guard only several of your endpoints.. \Accentinteractive\LaravelSso\Http\Middleware\AuthenticateSSO::class,

For Laravel >10, place it in bootstrap/app.php.

// [...]
->withMiddleware(function (Middleware $middleware) {

    // Register multitenancy middleware
    $middleware->appendToGroup('web', [
        \Accentinteractive\LaravelSso\Http\Middleware\AuthenticateSSO::class,
    ]);

For Laravel <=10, place it in app/Http/Kernel.php.

'web' => [
    // [...]
    \Accentinteractive\LaravelSso\Http\Middleware\AuthenticateSSO::class,
],

Step 5

Optionally you can publish the config file with:

php artisan vendor:publish --provider="Accentinteractive\LaravelSso\LaravelSsoServiceProvider" --tag="config"

Register a new Azure AD application

For Azure AD Single Sign On to work properly, you must supply the following Azure AD credentials in your .env file:

  • Application (client) ID
  • Directory (tenant) ID
  • Client Secret
  • Redirect URI

Important: your Client Secret has an expiration date. Before the secret expires, make sure to create another new secret and supply it in in .env, so you employees can continue to log using SSO. A good expiration time would be 12 or 24 months.

  • To create the Azure AD Plan Ahead application. IDs and secrets, do the following;
    • Go to Azure AD while logged in as Microsoft User for your organization: https://portal.azure.com/.
    • Go to App Registrations (https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade).
    • Click 'New Registration' to add your application.
      • Enter a name.
      • Select 'Accounts in this organizational directory only'.
      • Click 'Register'.
    • Make note of the Application (client) ID
    • Make note of the Directory (tenant) ID
    • Click 'Redirect URIs'.
      • Under 'Web', click 'Add URI'.
      • Enter the correct redirect URI (https://YOURDOMAIN.COM/login) and hit [ENTER]
      • Make note of the redirect URL.
    • Go back to the app Registration and click 'Client Credentials'.
      • Click 'New Client Secret'.
      • Enter a name for the secret.
      • Choose an expiry period (maximum 24 months).
      • Click 'Add'.
      • Make note of the 'Value' for your Client secret. Important: You can only view a secret once, directly after creation.
    • Go back to the app Registration and go to Manage › Manifest.
      • In the XML, edit "allowPublicClient" to say false.
      • In the XML, edit "oauth2AllowIdTokenImplicitFlow" to say true.
      • Click Save.
    • Before the secret expires, make sure to create another new secret and enter it to to your .env file in time, so you can continue to log with SSO.

Config settings

You can pass config settings to modify the behaviour.

You can also pass options directly.

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email joost@accentinteractive.nl instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

accentinteractive/laravel-sso 适用场景与选型建议

accentinteractive/laravel-sso 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 24 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 08 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「accentinteractive」 「laravel-sso」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 accentinteractive/laravel-sso 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 accentinteractive/laravel-sso 我们能提供哪些服务?
定制开发 / 二次开发

基于 accentinteractive/laravel-sso 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 30
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-08-07