Answered my own question, you can use core:PHP to do more advanced
manipulation of the content inside the $attributes array.
I added the below inside of authproc.idp inside my config.php so that
it would apply to all the SP's.
This replaces the memberOf string with content between CN= and the
first , (in other words the group name).
60 => array(
'class' => 'core:PHP',
'code' => '
if(!empty($attributes["memberOf"]))
{
$begin = "CN=";
$end = ",";
foreach($attributes["memberOf"] as $key => $value)
{
$pos_begin = strpos($value,$begin);
$pos_end = strpos($value,$end,($pos_begin+strlen($begin)));
if($pos_begin === false || $pos_end === false)
unset($attributes["memberOf"][$key]);
else
$attributes["memberOf"][$key] = substr($value,($pos_begin
+strlen($begin)),($pos_end-$pos_begin-strlen($begin)));
}
}
',
),