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: 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: Throws: \RuntimeException
when OpenSSL reports a problem
-
public
OC\Authentication\Token\IProvider::
getToken
($tokenId)¶ - Get a token by token id
Source: Parameters: - $tokenId (string)
Throws: Throws: Throws: Throws: Throws: Throws: Throws: Throws: Throws: Returns:
-
public
OC\Authentication\Token\IProvider::
getTokenById
($tokenId)¶ - Get a token by token id
Source: Parameters: - $tokenId (int)
Throws: Throws: Throws: Throws: Throws: Throws: Throws: Throws: Throws: Returns:
-
public
OC\Authentication\Token\IProvider::
renewSessionToken
($oldSessionId, $sessionId)¶ - Duplicate an existing session token
Source: Parameters: - $oldSessionId (string)
- $sessionId (string)
Throws: Throws: \RuntimeException
when OpenSSL reports a problemThrows: Throws: \RuntimeException
when OpenSSL reports a problemReturns: \OC\Authentication\Token\IToken
The new token
-
public
OC\Authentication\Token\IProvider::
invalidateToken
($token)¶ - Invalidate (delete) the given session token
Source: Parameters: - $token (string)
-
public
OC\Authentication\Token\IProvider::
invalidateTokenById
($uid, $id)¶ - Invalidate (delete) the given token
Source: 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: Parameters: - $token (
OC\Authentication\Token\IToken
)
- $token (
-
public
OC\Authentication\Token\IProvider::
updateTokenActivity
($token)¶ - Update token activity timestamp
Source: Parameters: - $token (
OC\Authentication\Token\IToken
)
- $token (
-
public
OC\Authentication\Token\IProvider::
getTokenByUser
($uid)¶ - Get all tokens of a userThe provider may limit the number of result rows in case of an abusewhere a high number of (session) tokens is generated
Source: Parameters: - $uid (string)
Returns:
-
public
OC\Authentication\Token\IProvider::
getPassword
($savedToken, $tokenId)¶ - Get the (unencrypted) password of the given token
Source: Parameters: - $savedToken (
OC\Authentication\Token\IToken
) - $tokenId (string)
Throws: Throws: Throws: Throws: Returns: string
- $savedToken (
-
public
OC\Authentication\Token\IProvider::
setPassword
($token, $tokenId, $password)¶ - Encrypt and set the password of the given token
Source: Parameters: - $token (
OC\Authentication\Token\IToken
) - $tokenId (string)
- $password (string)
Throws: - $token (
-
public
OC\Authentication\Token\IProvider::
rotate
($token, $oldTokenId, $newTokenId)¶ - Rotate the token. Usefull for for example oauth tokens
Source: Parameters: - $token (
OC\Authentication\Token\IToken
) - $oldTokenId (string)
- $newTokenId (string)
Returns: Throws: \RuntimeException
when OpenSSL reports a problem - $token (
-
public
OC\Authentication\Token\IProvider::
markPasswordInvalid
($token, $tokenId)¶ - Marks a token as having an invalid password.
Source: Parameters: - $token (
OC\Authentication\Token\IToken
) - $tokenId (string)
- $token (
-
public
OC\Authentication\Token\IProvider::
updatePasswords
($uid, $password)¶ - Update all the passwords of $uid if required
Source: Parameters: - $uid (string)
- $password (string)