Documentation

CiviGenericProvider extends GenericProvider uses ResponseModeTrait

Class CiviGenericProvider

Table of Contents

Properties

$responseModes  : array<string|int, mixed>|array<string|int, string>
List of supported response-modes.
$tenant  : string

Methods

getBaseAccessTokenUrl()  : string
Returns the base URL for requesting an access token.
getBaseAuthorizationUrl()  : string
Returns the base URL for authorizing a client.
getResponseModes()  : array<string|int, mixed>
setResponseModes()  : void
fetchResourceOwnerDetails()  : mixed
Requests resource owner details.
fillProperties()  : mixed
getAuthorizationParameters()  : mixed
decodeUnauthenticatedJwt()  : mixed
replaceTenantToken()  : string
Replace {{tenant}} in the endpoint URLs with 'common' for consumer accounts or the tenancy ID for dedicated services.

Properties

$responseModes

List of supported response-modes.

protected array<string|int, mixed>|array<string|int, string> $responseModes = ['query']

Some mix of values. At time of writing, Civi supports:

  • 'query': Values returned to the $redirectUri as query params. (Standard OAuth 2.0 behavior.)
  • 'web_message': Values returned via JS API: window.opener.postMessage(params, civicrmInstanceUrl) Requires the calling page to have a listener corresponding listener for window.addEventListener (where e.origin==findOrigin(urlAuthorize))
Tags
link
https://www.ietf.org/archive/id/draft-meyerzuselha-oauth-web-message-response-mode-00.html

Methods

getBaseAccessTokenUrl()

Returns the base URL for requesting an access token.

public getBaseAccessTokenUrl(array<string|int, mixed> $params) : string

Eg. https://oauth.service.com/token

Parameters
$params : array<string|int, mixed>
Return values
string

getBaseAuthorizationUrl()

Returns the base URL for authorizing a client.

public getBaseAuthorizationUrl() : string

Eg. https://oauth.service.com/authorize

Return values
string

getResponseModes()

public getResponseModes() : array<string|int, mixed>
Return values
array<string|int, mixed>

setResponseModes()

public setResponseModes(array<string|int, mixed> $responseModes) : void
Parameters
$responseModes : array<string|int, mixed>

fetchResourceOwnerDetails()

Requests resource owner details.

protected fetchResourceOwnerDetails(AccessToken $token) : mixed
Parameters
$token : AccessToken

fillProperties()

protected fillProperties([array<string|int, mixed> $options = [] ]) : mixed
Parameters
$options : array<string|int, mixed> = []

getAuthorizationParameters()

protected getAuthorizationParameters(array<string|int, mixed> $options) : mixed
Parameters
$options : array<string|int, mixed>

decodeUnauthenticatedJwt()

private decodeUnauthenticatedJwt(mixed $t) : mixed
Parameters
$t : mixed

replaceTenantToken()

Replace {{tenant}} in the endpoint URLs with 'common' for consumer accounts or the tenancy ID for dedicated services.

private replaceTenantToken(string $str) : string
Parameters
$str : string

URL to replace

Return values
string

        
On this page

Search results