diff --git a/app/Models/SnipeSCIMConfig.php b/app/Models/SnipeSCIMConfig.php index 4c13dc4ed..221bf7d2e 100644 --- a/app/Models/SnipeSCIMConfig.php +++ b/app/Models/SnipeSCIMConfig.php @@ -41,6 +41,9 @@ class SnipeSCIMConfig extends \ArieTimmerman\Laravel\SCIMServer\SCIMConfig } ); + $config['validations'][$core.'externalId'] = 'string'; // not required, but supported mostly just for Okta + $mappings['externalId'] = AttributeMapping::eloquent('scim_externalid'); + $config['validations'][$core.'emails'] = 'nullable|array'; // emails are not required in Snipe-IT... $config['validations'][$core.'emails.*.value'] = 'email'; // ...(had to remove the recommended 'required' here) diff --git a/database/migrations/2022_10_25_193823_add_externalid_to_users.php b/database/migrations/2022_10_25_193823_add_externalid_to_users.php new file mode 100644 index 000000000..2e9caca40 --- /dev/null +++ b/database/migrations/2022_10_25_193823_add_externalid_to_users.php @@ -0,0 +1,32 @@ +string('scim_externalid')->nullable()->default(null); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn('scim_externalid'); + }); + } +}