Skip to content

Instantly share code, notes, and snippets.

@laurentbel
Last active December 15, 2018 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laurentbel/9723832002d428534a707eab9a7f95b4 to your computer and use it in GitHub Desktop.
Save laurentbel/9723832002d428534a707eab9a7f95b4 to your computer and use it in GitHub Desktop.
User info behind AWS ALB and OIDC in PHP
<?php
// Get user info
$user_info = json_decode(base64_decode(explode('.', apache_request_headers()['X-Amzn-Oidc-Data'])[1]));
?>
<h2>User Info : </h2>
<p>
First Name : <?php echo $user_info->given_name; ?><br/>
Last Name : <?php echo $user_info->family_name; ?><br/>
Email : <?php echo $user_info->email; ?><br/>
</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment