| Methods |
public
|
__construct(Request $request = null, array<string, string> $data = [])
Creates an OAuth response.
Creates an OAuth response.
An OAuth response is created based on an OAuth request. The
response will contain the same state and redirect_uri
parameters as the underlying request.
Parameters
| $request |
the request to which the response will
be made
|
| $data |
the initial response parameters
|
Overrides
|
#
|
public
|
getResponseMode(): string
Gets the flow to be used in redirect responses.
Gets the flow to be used in redirect responses.
Returns
|
#
|
public
|
setResponseMode(string $response_mode): void
Sets the response mode to be used in redirect responses. This should
be either QUERY_RESPONSE_MODE or FRAGMENT_RESPONSE_MODE
Sets the response mode to be used in redirect responses. This should
be either QUERY_RESPONSE_MODE or FRAGMENT_RESPONSE_MODE
Parameters
| $response_mode |
the response mode
|
|
#
|
public
|
setRedirectURI(string $redirect_uri): void
Parameters
| $redirect_uri |
the redirect URI to set
|
|
#
|
public
|
getRedirectURI(): string
Returns the redirect URI.
Returns the redirect URI.
Returns
|
#
|
public
|
isError(): bool
Determines whether the current OAuth response is an error
response.
Determines whether the current OAuth response is an error
response.
A response is an error response if it contains the key error.
Returns
true if the response is an error response
|
#
|
public
|
setError(string $error, string $error_description = null, array<string, string> $additional = []): Response
Sets parameters in the current response so that it is an error response.
Sets parameters in the current response so that it is an error response.
Note that existing parameters set in the response are not removed.
Parameters
| $error |
the OAuth error code
|
| $error_description |
the OAuth error description
|
| $additional |
additional parameters to include
|
Returns
this object (for chaining)
|
#
|
public
|
renderRedirect(string $redirect_uri = null): void
Renders the response as a redirect or a form post.
Renders the response as a redirect or a form post.
Redirect responses are used in the OAuth authorization endpoint.
Parameters
| $redirect_uri |
the URL to which the response is sent.
If null, the $redirect_uri property will be used
|
|
#
|
public
|
renderJSON(int $status = null): void
Renders the response as a JSON object.
Renders the response as a JSON object.
JSON responses are used in the OAuth token endpoint, and other endpoints.
Parameters
| $status |
the HTTP status code. If null, the status code is 400
for error responses and 200 otherwise.
|
|
#
|
public
|
renderFormPost(string $url = null): void
Renders the response as a POST request.
Renders the response as a POST request.
Parameters
| $url |
the URL to which the response is sent
|
|
#
|
public
|
toArray()
|
#
|
public
static
|
getResponseModesSupported(): array<string>
Returns the response modes supported by this class.
Returns the response modes supported by this class.
Returns
|
#
|