]> BookStack Code Mirror - bookstack/commitdiff
Added azureAD social auth option
authorDan Brown <redacted>
Sun, 1 Oct 2017 12:19:17 +0000 (13:19 +0100)
committerDan Brown <redacted>
Sun, 1 Oct 2017 12:19:17 +0000 (13:19 +0100)
Closes #509

app/Providers/EventServiceProvider.php
app/Services/SocialAuthService.php
composer.json
composer.lock
config/services.php
resources/assets/icons/azure.svg [new file with mode: 0644]

index d82a560f99987fef423adb6db969b01cc5314f49..ac4e7bc356cab30b3959fce47c49fbbf278246c1 100644 (file)
@@ -16,6 +16,7 @@ class EventServiceProvider extends ServiceProvider
     protected $listen = [
         SocialiteWasCalled::class => [
             'SocialiteProviders\Slack\SlackExtendSocialite@handle',
+            'SocialiteProviders\Azure\AzureExtendSocialite@handle',
         ],
     ];
 
index ddcdc9ba63a042363fb4626a38d17f88e7adc45e..6d5b401d12752545fc4f7840959edc47d40ca512 100644 (file)
@@ -14,7 +14,7 @@ class SocialAuthService
     protected $socialite;
     protected $socialAccount;
 
-    protected $validSocialDrivers = ['google', 'github', 'facebook', 'slack', 'twitter'];
+    protected $validSocialDrivers = ['google', 'github', 'facebook', 'slack', 'twitter', 'azure'];
 
     /**
      * SocialAuthService constructor.
index 2381c534bbc035f03b544918d5d1122ae5554161..6d86057bca843cd3f0cf83a28093716c117905a1 100644 (file)
@@ -18,7 +18,8 @@
         "gathercontent/htmldiff": "^0.2.1",
         "barryvdh/laravel-snappy": "^0.3.1",
         "laravel/browser-kit-testing": "^1.0",
-        "socialiteproviders/slack": "^3.0"
+        "socialiteproviders/slack": "^3.0",
+        "socialiteproviders/microsoft-azure": "^3.0"
     },
     "require-dev": {
         "fzaninotto/faker": "~1.4",
index 54218ee481fe76d9b364a8c29d6f5a6cc2365a29..bad47199c540be24fc1cacc4293a1e4091cb73c8 100644 (file)
@@ -4,8 +4,8 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "hash": "e6d32752d02dae662bedc69fa5856feb",
-    "content-hash": "5f0f4e912f1207e761caf9344f2308a0",
+    "hash": "aa5f3333b909857a179e6aa9c30ab9ab",
+    "content-hash": "dc4c98aa8942f27fde6a9faa440e1a74",
     "packages": [
         {
             "name": "aws/aws-sdk-php",
             "description": "Easily add new or override built-in providers in Laravel Socialite.",
             "time": "2017-02-07 07:26:42"
         },
+        {
+            "name": "socialiteproviders/microsoft-azure",
+            "version": "v3.0.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/SocialiteProviders/Microsoft-Azure.git",
+                "reference": "d7a703a782eb9f7eae0db803beaa3ddec19ef372"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/SocialiteProviders/Microsoft-Azure/zipball/d7a703a782eb9f7eae0db803beaa3ddec19ef372",
+                "reference": "d7a703a782eb9f7eae0db803beaa3ddec19ef372",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^5.6 || ^7.0",
+                "socialiteproviders/manager": "~3.0"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "SocialiteProviders\\Azure\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Chris Hemmings",
+                    "email": "[email protected]"
+                }
+            ],
+            "description": "Microsoft Azure OAuth2 Provider for Laravel Socialite",
+            "time": "2017-01-25 09:48:29"
+        },
         {
             "name": "socialiteproviders/slack",
             "version": "v3.0.1",
index b4959c7249cbbffb0024bc448e8ec00bb452172a..a012585a14bcf06cd44228f0cdba5b81e038c632 100644 (file)
@@ -72,6 +72,14 @@ return [
         'name'          => 'Twitter',
     ],
 
+    'azure'   => [
+        'client_id'     => env('AZURE_APP_ID', false),
+        'client_secret' => env('AZURE_APP_SECRET', false),
+        'tenant'       => env('AZURE_TENANT', false),
+        'redirect'      => env('APP_URL') . '/login/service/azure/callback',
+        'name'          => 'Microsoft Azure',
+    ],
+
     'ldap' => [
         'server' => env('LDAP_SERVER', false),
         'dn' => env('LDAP_DN', false),
diff --git a/resources/assets/icons/azure.svg b/resources/assets/icons/azure.svg
new file mode 100644 (file)
index 0000000..8e7fdea
--- /dev/null
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 129 129"><path fill="#f25022" d="M0 0h61.3v61.3H0z"/><path fill="#7fba00" d="M67.7 0H129v61.3H67.7z"/><path fill="#00a4ef" d="M0 67.7h61.3V129H0z"/><path fill="#ffb900" d="M67.7 67.7H129V129H67.7z"/></svg>
\ No newline at end of file