functions.php
Table of Contents
- generateRandomString() : string
- generateRandomPrintableAsciiString() : string
- generatePKCECodeChallenge() : string
- base64_urlencode() : string
- hashAuthorizationRequestParameters() : string|null
- isIndieAuthAuthorizationCodeRedeemingRequest() : bool
- isIndieAuthAuthorizationRequest() : bool
- isAuthorizationApprovalRequest() : bool
- buildQueryString() : string
- urlComponentsMatch() : bool
- appendQueryParams() : string
- Append Query Parameters
- trySetLogger() : mixed
- Try setLogger
- renderTemplate() : mixed
- isClientIdentifier() : bool
- Check if a provided string matches the IndieAuth criteria for a Client Identifier.
- isProfileUrl() : bool
- Check if a provided string matches the IndieAuth criteria for a User Profile URL.
- isValidState() : bool
- OAuth 2.0 limits what values are valid for state.
- isValidCodeChallenge() : bool
- IndieAuth requires PKCE. This implementation supports only S256 for hashing.
- isValidScope() : bool
- OAuth 2.0 limits what values are valid for scope.
Functions
generateRandomString()
generateRandomString(int $numBytes) : string
Parameters
- $numBytes : int
generateRandomPrintableAsciiString()
generateRandomPrintableAsciiString(int $length) : string
Parameters
- $length : int
generatePKCECodeChallenge()
generatePKCECodeChallenge(string $plaintext) : string
Parameters
- $plaintext : string
base64_urlencode()
base64_urlencode(string $string) : string
Parameters
- $string : string
hashAuthorizationRequestParameters()
hashAuthorizationRequestParameters(ServerRequestInterface $request, string $secret[, string|null $algo = null ][, array<string|int, mixed>|null $hashedParameters = null ][, bool $requirePkce = true ]) : string|null
Parameters
- $request : ServerRequestInterface
- $secret : string
- $algo : string|null = null
- $hashedParameters : array<string|int, mixed>|null = null
- $requirePkce : bool = true
isIndieAuthAuthorizationCodeRedeemingRequest()
isIndieAuthAuthorizationCodeRedeemingRequest(ServerRequestInterface $request) : bool
Parameters
- $request : ServerRequestInterface
isIndieAuthAuthorizationRequest()
isIndieAuthAuthorizationRequest(ServerRequestInterface $request[, array<string|int, mixed> $permittedMethods = ['get'] ]) : bool
Parameters
- $request : ServerRequestInterface
- $permittedMethods : array<string|int, mixed> = ['get']
isAuthorizationApprovalRequest()
isAuthorizationApprovalRequest(ServerRequestInterface $request) : bool
Parameters
- $request : ServerRequestInterface
buildQueryString()
buildQueryString(array<string|int, mixed> $parameters) : string
Parameters
- $parameters : array<string|int, mixed>
urlComponentsMatch()
urlComponentsMatch(string $url1, string $url2[, array<string|int, mixed>|null $components = null ]) : bool
Parameters
- $url1 : string
- $url2 : string
- $components : array<string|int, mixed>|null = null
appendQueryParams()
Append Query Parameters
appendQueryParams(string $uri, array<string|int, mixed> $queryParams) : string
Converts $queryParams
into a query string, then checks $uri
for an
existing query string. Then appends the newly generated query string
with either ? or & as appropriate.
Parameters
- $uri : string
- $queryParams : array<string|int, mixed>
trySetLogger()
Try setLogger
trySetLogger(mixed $target, LoggerInterface $logger) : mixed
If $target
implements LoggerAwareInterface
, set it’s logger
to $logger
. Returns $target
.
Parameters
- $target : mixed
- $logger : LoggerInterface
Tags
renderTemplate()
renderTemplate(string $template[, array<string|int, mixed> $context = [] ]) : mixed
Parameters
- $template : string
- $context : array<string|int, mixed> = []
isClientIdentifier()
Check if a provided string matches the IndieAuth criteria for a Client Identifier.
isClientIdentifier(string $client_id) : bool
Parameters
- $client_id : string
-
The client ID provided by the OAuth Client
Tags
isProfileUrl()
Check if a provided string matches the IndieAuth criteria for a User Profile URL.
isProfileUrl(string $profile_url) : bool
Parameters
- $profile_url : string
-
The profile URL provided by the IndieAuth Client as me
Tags
isValidState()
OAuth 2.0 limits what values are valid for state.
isValidState(string $state) : bool
We check this first, because if valid, we want to send it along with other errors.
Parameters
- $state : string
Tags
isValidCodeChallenge()
IndieAuth requires PKCE. This implementation supports only S256 for hashing.
isValidCodeChallenge(string $challenge) : bool
Parameters
- $challenge : string
Tags
isValidScope()
OAuth 2.0 limits what values are valid for scope.
isValidScope(string $scope) : bool
Parameters
- $scope : string