title: Reading Shibboleth attributes in Node.js
body: <p>I am trying to port a Perl script, which successfully reads and consumes Shibboleth session attributes, into Node.js. The Perl code looks, for example, like this:</p>
  
  <pre><code>die "Must be protected behind shibboleth authentication" unless $ENV{'AUTH_TYPE'} eq 'shibboleth';
  die "Requires eppn" unless $ENV{'eppn'} ne "";
  my $user = $ENV{'eppn'};
  my $shib_session_id = $ENV{'Shib-Session-ID'};
  </code></pre>
  
  <p>It appears as though the Shibboleth attributes are available to Perl as environment variables. As far as I can tell (I don't know Perl), there is nothing within the script that is fetching or altering these values.</p>
  
  <p>So, I checked <code>process.env</code>, in my Node.js app, and none of these values exist. Nor do they, as far as I have searched, exist in the request object created by Express.js.</p>
  
  <p>The Perl script is on an Apache server, but nothing in the <code>httpd.conf</code> looks like it's passing anything special to the Perl script. My Node.js app is reversed proxied on the same Apache server.</p>
  
  <p>Is it possible to get the Shibboleth attributes in Node.js, or does it rely on some Perl/Apache/Shibboleth magic?</p>