DefaultTokenProvider

class OC\Authentication\Token\DefaultTokenProvider
Source:lib/private/Authentication/Token/DefaultTokenProvider.php#45
Implements:OC\Authentication\Token\IProvider

Properties

Methods

public OC\Authentication\Token\DefaultTokenProvider::__construct($mapper, $crypto, $config, $logger, $time)
Source:lib/private/Authentication/Token/DefaultTokenProvider.php#62
public OC\Authentication\Token\DefaultTokenProvider::generateToken($token, $uid, $loginName, $password, $name, $type=\OC\Authentication\Token\IToken::TEMPORARY_TOKEN, $remember=\OC\Authentication\Token\IToken::DO_NOT_REMEMBER)
Create and persist a new token
Source:

lib/private/Authentication/Token/DefaultTokenProvider.php#86

Parameters:
  • $token (string)
  • $uid (string)
  • $loginName (string)
  • $password (string | null)
  • $name (string)
  • $type (int) token type
  • $remember (int) whether the session token should be used for remember-me
Returns:

\OC\Authentication\Token\IToken

public OC\Authentication\Token\DefaultTokenProvider::updateToken($token)
Save the updated token
Source:

lib/private/Authentication/Token/DefaultTokenProvider.php#118

Parameters:
Throws:

\OC\Authentication\Exceptions\InvalidTokenException

public OC\Authentication\Token\DefaultTokenProvider::updateTokenActivity($token)
Update token activity timestamp
Source:

lib/private/Authentication/Token/DefaultTokenProvider.php#131

Parameters:
Throws:

\OC\Authentication\Exceptions\InvalidTokenException

public OC\Authentication\Token\DefaultTokenProvider::getTokenByUser($uid)
Source:lib/private/Authentication/Token/DefaultTokenProvider.php#144
public OC\Authentication\Token\DefaultTokenProvider::getToken($tokenId)
Get a token by token
Source:

lib/private/Authentication/Token/DefaultTokenProvider.php#156

Parameters:
  • $tokenId (string)
Throws:

\OC\Authentication\Exceptions\InvalidTokenException

Throws:

\OC\Authentication\Exceptions\ExpiredTokenException

Throws:

\OC\Authentication\Exceptions\InvalidTokenException

Throws:

\OC\Authentication\Exceptions\ExpiredTokenException

Returns:

\OC\Authentication\Token\IToken

public OC\Authentication\Token\DefaultTokenProvider::getTokenById($tokenId)
Get a token by token id
Source:

lib/private/Authentication/Token/DefaultTokenProvider.php#178

Parameters:
  • $tokenId (int)
Throws:

\OC\Authentication\Exceptions\InvalidTokenException

Throws:

\OC\Authentication\Exceptions\ExpiredTokenException

Throws:

\OC\Authentication\Exceptions\InvalidTokenException

Throws:

\OC\Authentication\Exceptions\ExpiredTokenException

Returns:

\OC\Authentication\Token\IToken

public OC\Authentication\Token\DefaultTokenProvider::renewSessionToken($oldSessionId, $sessionId)
Source:

lib/private/Authentication/Token/DefaultTokenProvider.php#198

Parameters:
  • $oldSessionId (string)
  • $sessionId (string)
Throws:

\OC\Authentication\Exceptions\InvalidTokenException

Returns:

\OC\Authentication\Token\IToken

public OC\Authentication\Token\DefaultTokenProvider::getPassword($savedToken, $tokenId)
Source:

lib/private/Authentication/Token/DefaultTokenProvider.php#226

Parameters:
Throws:

\OC\Authentication\Exceptions\InvalidTokenException

Throws:

\OC\Authentication\Exceptions\PasswordlessTokenException

Throws:

\OC\Authentication\Exceptions\InvalidTokenException

Throws:

\OC\Authentication\Exceptions\PasswordlessTokenException

Returns:

string

public OC\Authentication\Token\DefaultTokenProvider::setPassword($token, $tokenId, $password)
Encrypt and set the password of the given token
Source:

lib/private/Authentication/Token/DefaultTokenProvider.php#242

Parameters:
Throws:

\OC\Authentication\Exceptions\InvalidTokenException

public OC\Authentication\Token\DefaultTokenProvider::invalidateToken($token)
Invalidate (delete) the given session token
Source:

lib/private/Authentication/Token/DefaultTokenProvider.php#256

Parameters:
  • $token (string)
public OC\Authentication\Token\DefaultTokenProvider::invalidateTokenById($uid, $id)
Source:lib/private/Authentication/Token/DefaultTokenProvider.php#260
public OC\Authentication\Token\DefaultTokenProvider::invalidateOldTokens()
Invalidate (delete) old session tokens
Source:lib/private/Authentication/Token/DefaultTokenProvider.php#267
public OC\Authentication\Token\DefaultTokenProvider::rotate($token, $oldTokenId, $newTokenId)
Rotate the token. Usefull for for example oauth tokens
Source:

lib/private/Authentication/Token/DefaultTokenProvider.php#284

Parameters:
Returns:

\OC\Authentication\Token\IToken

public OC\Authentication\Token\DefaultTokenProvider::markPasswordInvalid($token, $tokenId)
Source:lib/private/Authentication/Token/DefaultTokenProvider.php#341
public OC\Authentication\Token\DefaultTokenProvider::updatePasswords($uid, $password)
Source:lib/private/Authentication/Token/DefaultTokenProvider.php#350