ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Jumbojett Namespace Reference

Copyright MITRE 2020. More...

Data Structures

class  OpenIDConnectClient
 Require the CURL and JSON PHP extensions to be installed. More...
 
class  OpenIDConnectClientException
 OpenIDConnect Exception Class. More...
 

Functions

if(!class_exists('\phpseclib\Crypt\RSA') &&!class_exists('Crypt_RSA')) base64url_decode ($base64url)
 JWT signature verification support by Jonathan Reed jdree.nosp@m.d@mi.nosp@m.t.edu Licensed under the same license as the rest of this file. More...
 
 b64url2b64 ($base64url)
 Per RFC4648, "base64 encoding with URL-safe and filename-safe alphabet". More...
 

Detailed Description

Copyright MITRE 2020.

OpenIDConnectClient for PHP5 Author: Michael Jett mjett.nosp@m.@mit.nosp@m.re.or.nosp@m.g

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ b64url2b64()

Jumbojett\b64url2b64 (   $base64url)

Per RFC4648, "base64 encoding with URL-safe and filename-safe alphabet".

This just replaces characters 62 and 63. None of the reference implementations seem to restore the padding if necessary, but we'll do it anyway.

Parameters
string$base64url
Returns
string

Definition at line 56 of file OpenIDConnectClient.php.

Referenced by base64url_decode(), and Jumbojett\OpenIDConnectClient\verifyRSAJWTsignature().

56  {
57  // "Shouldn't" be necessary, but why not
58  $padding = strlen($base64url) % 4;
59  if ($padding > 0) {
60  $base64url .= str_repeat('=', 4 - $padding);
61  }
62  return strtr($base64url, '-_', '+/');
63 }
64 
65 
69 class OpenIDConnectClientException extends \Exception
70 {
71 
72 }
73 
77 if (!function_exists('curl_init')) {
78  throw new OpenIDConnectClientException('OpenIDConnect needs the CURL PHP extension.');
79 }
80 if (!function_exists('json_decode')) {
81  throw new OpenIDConnectClientException('OpenIDConnect needs the JSON PHP extension.');
82 }
+ Here is the caller graph for this function:

◆ base64url_decode()

if (!class_exists('\phpseclib\Crypt\RSA') &&!class_exists( 'Crypt_RSA')) Jumbojett\base64url_decode (   $base64url)

JWT signature verification support by Jonathan Reed jdree.nosp@m.d@mi.nosp@m.t.edu Licensed under the same license as the rest of this file.

phpseclib is required to validate the signatures of some tokens. It can be downloaded from: http://phpseclib.sourceforge.net/ A wrapper around base64_decode which decodes Base64URL-encoded data, which is not the same alphabet as base64.

Parameters
string$base64url
Returns
bool|string

Definition at line 44 of file OpenIDConnectClient.php.

References b64url2b64().

Referenced by Jumbojett\OpenIDConnectClient\decodeJWT(), and Jumbojett\OpenIDConnectClient\verifyJWTsignature().

44  {
45  return base64_decode(b64url2b64($base64url));
46 }
b64url2b64($base64url)
Per RFC4648, "base64 encoding with URL-safe and filename-safe alphabet".
+ Here is the call graph for this function:
+ Here is the caller graph for this function: