Add externalId support to SCIM integration

This commit is contained in:
Brady Wetherington 2022-10-25 14:19:01 -07:00
parent 3b16157d6b
commit 1e3281c76c
2 changed files with 35 additions and 0 deletions

View file

@ -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)

View file

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddExternalidToUsers extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->string('scim_externalid');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('scim_externalid');
});
}
}