class ClientFactory (View source)

Properties

private Application $app
private EntityManager $entityManager
private UuidGenerator $generator

Methods

__construct(Application $app, EntityManager $entityManager, UuidGenerator $generator)

No description

createClient(string $name, string $redirect, array $scopes, string $key, string $secret)

Create a new OAuth client object and provide it a proper UUID

generateCredentials(int $keyLength = 64, int $secretLength = 96)

Generate new credentials for use with a client Note: the secret provided by with these credentials is in plain text and should be hashed before storing to the database.

bool|string
generateString($length)

Generate a cryptographically secure strig

Details

__construct(Application $app, EntityManager $entityManager, UuidGenerator $generator)

No description

Parameters

Application $app
EntityManager $entityManager
UuidGenerator $generator

Client createClient(string $name, string $redirect, array $scopes, string $key, string $secret)

Create a new OAuth client object and provide it a proper UUID

Parameters

string $name

The client name

string $redirect

The redirect url

array $scopes

The scopes this client is allowed to interact with

string $key

The client's api key

string $secret

This secret should be properly hashed with something like password_hash

Return Value

Client

Credentials generateCredentials(int $keyLength = 64, int $secretLength = 96)

Generate new credentials for use with a client Note: the secret provided by with these credentials is in plain text and should be hashed before storing to the database.

Parameters

int $keyLength
int $secretLength

Return Value

Credentials

Exceptions

InvalidArgumentException

protected bool|string generateString($length)

Generate a cryptographically secure strig

Parameters

$length

Return Value

bool|string