ConnectController
extends Controller
in package
Tags
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
$tokenManager
private
mixed
$tokenManager
Methods
__construct()
public
__construct([CsrfTokenManagerInterface $tokenManager = null ]) : mixed
Parameters
- $tokenManager : CsrfTokenManagerInterface = null
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
Return values
ResponseconnectServiceAction()
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
Return values
ResponseredirectToServiceAction()
public
redirectToServiceAction(Request $request, string $service) : RedirectResponse
Parameters
- $request : Request
- $service : string
Tags
Return values
RedirectResponseregistrationAction()
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
Return values
ResponseauthenticateUser()
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
Return values
stringgetErrorForRequest()
Get the security error for a given request.
protected
getErrorForRequest(Request $request) : string|Exception
Parameters
- $request : Request
Return values
string|ExceptiongetResourceOwnerByName()
Get a resource owner by name.
protected
getResourceOwnerByName(string $name) : ResourceOwnerInterface
Parameters
- $name : string
Tags
Return values
ResourceOwnerInterfacegetConfirmationResponse()
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
Return values
ResponsegetTargetPath()
private
getTargetPath(SessionInterface $session) : string|null
Parameters
- $session : SessionInterface