You are here

function oauth2_server_base64url_decode in OAuth2 Server 7

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 oauth2_server_base64url_decode()
OAuth2ServerTestCase::assertIdToken in tests/oauth2_server.test
Assert that the given id_token response has the expected values.
OAuth2ServerTestCase::testOpenIdConnectNonDefaultSubInIdToken in tests/oauth2_server.test
Tests that the OpenID Connect 'sub' property affects ID token 'sub' claim.
Storage::getAuthorizationCode in lib/Drupal/oauth2_server/Storage.php

File

./oauth2_server.module, line 877
Provides OAuth2 server functionality.

Code

function oauth2_server_base64url_decode($data) {
  $data = str_replace(array(
    '-',
    '_',
  ), array(
    '+',
    '/',
  ), $data);
  return base64_decode($data);
}