You are here

public static function Utility::base64urlDecode in OAuth2 Server 8

Same name and namespace in other branches
  1. 2.0.x src/Utility.php \Drupal\oauth2_server\Utility::base64urlDecode()

Decodes base64url encoded data.

Parameters

string $data: A string containing the base64url encoded data.

Return value

string|false The decoded data, or FALSE on failure.

3 calls to Utility::base64urlDecode()
OAuth2ServerTest::assertIdToken in tests/src/Functional/OAuth2ServerTest.php
Assert that the given id_token response has the expected values.
OAuth2ServerTest::testOpenIdConnectNonDefaultSubInIdToken in tests/src/Functional/OAuth2ServerTest.php
Tests that the OpenID Connect 'sub' property affects ID token 'sub' claim.
OAuth2Storage::getAuthorizationCode in src/OAuth2Storage.php
Get authorization code.

File

src/Utility.php, line 68

Class

Utility
Contains utility methods for the OAuth2 Server.

Namespace

Drupal\oauth2_server

Code

public static function base64urlDecode($data) {
  $data = str_replace([
    '-',
    '_',
  ], [
    '+',
    '/',
  ], $data);
  return base64_decode($data);
}