1<?php 2 3/** 4 * 5 * Copyright MITRE 2012 6 * 7 * OpenIDConnectClient for PHP5 8 * Author: Michael Jett <mjett@mitre.org> 9 * 10 * Licensed under the Apache License, Version 2.0 (the "License"); you may 11 * not use this file except in compliance with the License. You may obtain 12 * a copy of the License at 13 * 14 * http://www.apache.org/licenses/LICENSE-2.0 15 * 16 * Unless required by applicable law or agreed to in writing, software 17 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 18 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 19 * License for the specific language governing permissions and limitations 20 * under the License. 21 * 22 */ 23 24require __DIR__ . '/vendor/autoload.php'; 25 26use Jumbojett\OpenIDConnectClient; 27 28$oidc = new OpenIDConnectClient( 29 'http://myproviderURL.com/', 30 'ClientIDHere', 31 'ClientSecretHere' 32); 33 34$oidc->authenticate(); 35$name = $oidc->requestUserInfo('given_name'); 36 37?> 38 39<html> 40<head> 41 <title>Example OpenID Connect Client Use</title> 42 <style> 43 body { 44 font-family: 'Lucida Grande', Verdana, Arial, sans-serif; 45 } 46 </style> 47</head> 48<body> 49 50 <div> 51 Hello <?php echo $name; ?> 52 </div> 53 54</body> 55</html> 56 57