Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117368856
D5046.1774817496.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D5046.1774817496.diff
View Options
diff --git a/config.prod/src/database/migrations/2024_12_05_100000_create_passport_sso_client.php b/config.prod/src/database/migrations/2024_12_05_100000_create_passport_sso_client.php
new file mode 100644
--- /dev/null
+++ b/config.prod/src/database/migrations/2024_12_05_100000_create_passport_sso_client.php
@@ -0,0 +1,40 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Laravel\Passport\Passport;
+
+return new class extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ // Create a client for Webmail SSO
+ $client = Passport::client()->forceFill([
+ 'user_id' => null,
+ 'name' => 'Webmail SSO client',
+ 'secret' => \config('auth.sso.client_secret'),
+ 'provider' => 'users',
+ 'redirect' => (str_starts_with(\config('app.webmail_url'), 'http') ? '' : 'https://' . \config('app.website_domain')) . \config('app.webmail_url') . 'index.php/login/oauth',
+ 'personal_access_client' => 0,
+ 'password_client' => 0,
+ 'revoked' => false,
+ 'allowed_scopes' => ['email', 'auth.token'],
+ ]);
+ $client->id = \config('auth.sso.client_id');
+ $client->save();
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Passport::client()->where('name', 'Webmail SSO client')->delete();
+ }
+};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 29, 8:51 PM (4 d, 8 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18776151
Default Alt Text
D5046.1774817496.diff (1 KB)
Attached To
Mode
D5046: Create a client for webmail sso via migration
Attached
Detach File
Event Timeline