title: How to get username in simplesamlphp saml response using php?
body: <p>I'm new to saml, I need to decode saml response using php and get username in it, how can I do it? Here is my index page code</p>
  
  <p>`        
  
  <pre><code> require_once('/var/simplesamlphp/lib/_autoload.php');
  
   $as = new SimpleSAML_Auth_Simple('default-sp');
   $as-&gt;requireAuth();
   $attributes = $as-&gt;getAttributes();
   print_r($attributes);
  
   if(array_key_exists('http://exm/claims/role', $attributes)) {
  
   }
       $exp_atr=  explode(",", $attributes['http://exm/claims/role'][0]);
  
  
     if (in_array("admin_group", $exp_atr)) {
     header("location:index_admin.php");
      }
     else {
  
      header("location:index_others.php");
      }
  
       ?&gt;`
  </code></pre>