IProvider

interface OC\Authentication\Token\IProvider
Implemented by:OC\Authentication\Token\DefaultTokenProvider OC\Authentication\Token\Manager OC\Authentication\Token\PublicKeyTokenProvider
Source:lib/private/Authentication/Token/IProvider.php#38

Methods

public OC\Authentication\Token\IProvider::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/IProvider.php#54

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

Throws:

\RuntimeException when OpenSSL reports a problem

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

lib/private/Authentication/Token/IProvider.php#71

Parameters:
  • $tokenId (string)
Throws:

\OC\Authentication\Exceptions\InvalidTokenException

Throws:

\OC\Authentication\Exceptions\ExpiredTokenException

Throws:

\OC\Authentication\Exceptions\WipeTokenException

Throws:

\OC\Authentication\Exceptions\InvalidTokenException

Throws:

\OC\Authentication\Exceptions\ExpiredTokenException

Throws:

\OC\Authentication\Exceptions\WipeTokenException

Throws:

\OC\Authentication\Exceptions\InvalidTokenException

Throws:

\OC\Authentication\Exceptions\ExpiredTokenException

Throws:

\OC\Authentication\Exceptions\WipeTokenException

Returns:

\OC\Authentication\Token\IToken

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

lib/private/Authentication/Token/IProvider.php#82

Parameters:
  • $tokenId (int)
Throws:

\OC\Authentication\Exceptions\InvalidTokenException

Throws:

\OC\Authentication\Exceptions\ExpiredTokenException

Throws:

\OC\Authentication\Exceptions\WipeTokenException

Throws:

\OC\Authentication\Exceptions\InvalidTokenException

Throws:

\OC\Authentication\Exceptions\ExpiredTokenException

Throws:

\OC\Authentication\Exceptions\WipeTokenException

Throws:

\OC\Authentication\Exceptions\InvalidTokenException

Throws:

\OC\Authentication\Exceptions\ExpiredTokenException

Throws:

\OC\Authentication\Exceptions\WipeTokenException

Returns:

\OC\Authentication\Token\IToken

public OC\Authentication\Token\IProvider::renewSessionToken($oldSessionId, $sessionId)
Duplicate an existing session token
Source:

lib/private/Authentication/Token/IProvider.php#93

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

\OC\Authentication\Exceptions\InvalidTokenException

Throws:

\RuntimeException when OpenSSL reports a problem

Throws:

\OC\Authentication\Exceptions\InvalidTokenException

Throws:

\RuntimeException when OpenSSL reports a problem

Returns:

\OC\Authentication\Token\IToken The new token

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

lib/private/Authentication/Token/IProvider.php#100

Parameters:
  • $token (string)
public OC\Authentication\Token\IProvider::invalidateTokenById($uid, $id)
Invalidate (delete) the given token
Source:

lib/private/Authentication/Token/IProvider.php#108

Parameters:
  • $uid (string)
  • $id (int)
public OC\Authentication\Token\IProvider::invalidateOldTokens()
Invalidate (delete) old session tokens
Source:lib/private/Authentication/Token/IProvider.php#113
public OC\Authentication\Token\IProvider::updateToken($token)
Save the updated token
Source:

lib/private/Authentication/Token/IProvider.php#120

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

lib/private/Authentication/Token/IProvider.php#127

Parameters:
public OC\Authentication\Token\IProvider::getTokenByUser($uid)
Get all tokens of a user
The provider may limit the number of result rows in case of an abuse
where a high number of (session) tokens is generated
Source:

lib/private/Authentication/Token/IProvider.php#138

Parameters:
  • $uid (string)
Returns:

\OC\Authentication\Token\IToken[]

public OC\Authentication\Token\IProvider::getPassword($savedToken, $tokenId)
Get the (unencrypted) password of the given token
Source:

lib/private/Authentication/Token/IProvider.php#149

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\IProvider::setPassword($token, $tokenId, $password)
Encrypt and set the password of the given token
Source:

lib/private/Authentication/Token/IProvider.php#159

Parameters:
Throws:

\OC\Authentication\Exceptions\InvalidTokenException

public OC\Authentication\Token\IProvider::rotate($token, $oldTokenId, $newTokenId)
Rotate the token. Usefull for for example oauth tokens
Source:

lib/private/Authentication/Token/IProvider.php#170

Parameters:
Returns:

\OC\Authentication\Token\IToken

Throws:

\RuntimeException when OpenSSL reports a problem

public OC\Authentication\Token\IProvider::markPasswordInvalid($token, $tokenId)
Marks a token as having an invalid password.
Source:

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

Parameters:
public OC\Authentication\Token\IProvider::updatePasswords($uid, $password)
Update all the passwords of $uid if required
Source:

lib/private/Authentication/Token/IProvider.php#186

Parameters:
  • $uid (string)
  • $password (string)