Documentation

ConnectController extends Controller
in package

Tags
author

Alexander iam.asm89@gmail.com

Table of Contents

Properties

$tokenManager  : mixed

Methods

__construct()  : mixed
connectAction()  : Response
Action that handles the login 'form'. If connecting is enabled the user will be redirected to the appropriate login urls or registration forms.
connectServiceAction()  : Response
Connects a user to a given account if the user is logged in and connect is enabled.
redirectToServiceAction()  : RedirectResponse
registrationAction()  : Response
Shows a registration form if there is no user logged in and connecting is enabled.
authenticateUser()  : mixed
Authenticate a user with Symfony Security.
generate()  : string
Generates a route.
getErrorForRequest()  : string|Exception
Get the security error for a given request.
getResourceOwnerByName()  : ResourceOwnerInterface
Get a resource owner by name.
getConfirmationResponse()  : Response
getTargetPath()  : string|null

Properties

Methods

connectAction()

Action that handles the login 'form'. If connecting is enabled the user will be redirected to the appropriate login urls or registration forms.

public connectAction(Request $request) : Response
Parameters
$request : Request
Tags
throws
LogicException
Return values
Response

connectServiceAction()

Connects a user to a given account if the user is logged in and connect is enabled.

public connectServiceAction(Request $request, string $service) : Response
Parameters
$request : Request

the active request

$service : string

name of the resource owner to connect to

Tags
throws
Exception
throws
NotFoundHttpException

if connect functionality was not enabled

throws
AccessDeniedException

if no user is authenticated

Return values
Response

registrationAction()

Shows a registration form if there is no user logged in and connecting is enabled.

public registrationAction(Request $request, string $key) : Response
Parameters
$request : Request

a request

$key : string

key used for retrieving the right information for the registration form

Tags
throws
NotFoundHttpException

if connect functionality was not enabled

throws
AccessDeniedException

if any user is authenticated

throws
RuntimeException
Return values
Response

authenticateUser()

Authenticate a user with Symfony Security.

protected authenticateUser(Request $request, UserInterface $user, string $resourceOwnerName, string $accessToken[, bool $fakeLogin = true ]) : mixed
Parameters
$request : Request
$user : UserInterface
$resourceOwnerName : string
$accessToken : string
$fakeLogin : bool = true

generate()

Generates a route.

protected generate(string $route[, array<string|int, mixed> $params = [] ][, bool $absolute = false ]) : string
Parameters
$route : string

Route name

$params : array<string|int, mixed> = []

Route parameters

$absolute : bool = false

absolute url or note

Tags
deprecated

since version 0.4. Will be removed in 1.0.

Return values
string

getErrorForRequest()

Get the security error for a given request.

protected getErrorForRequest(Request $request) : string|Exception
Parameters
$request : Request
Return values
string|Exception

getResourceOwnerByName()

Get a resource owner by name.

protected getResourceOwnerByName(string $name) : ResourceOwnerInterface
Parameters
$name : string
Tags
throws
NotFoundHttpException

if there is no resource owner with the given name

Return values
ResourceOwnerInterface

getConfirmationResponse()

private getConfirmationResponse(Request $request, array<string|int, mixed> $accessToken, string $service) : Response
Parameters
$request : Request

The active request

$accessToken : array<string|int, mixed>

The access token

$service : string

Name of the resource owner to connect to

Tags
throws
NotFoundHttpException

if there is no resource owner with the given name

Return values
Response

        
On this page

Search results