Last active
August 12, 2024 15:09
-
-
Save laurentbel/9723832002d428534a707eab9a7f95b4 to your computer and use it in GitHub Desktop.
User info behind AWS ALB and OIDC in PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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