Interface ITokenService

All Known Implementing Classes:
MockTokenService

public interface ITokenService
  • Field Details

  • Method Details

    • checkHash

      boolean checkHash(String hash, String streamId, String sessionId, String type)
      Compare hash string with computed one which is based on streamId,type and secret
      Parameters:
      hash - - client hash
      streamId - - id of the stream
      sessionId - - session of the request
      type - - type of the request (publish/play)
      Returns:
    • checkToken

      boolean checkToken(String tokenId, String streamId, String sessionId, String type)
      Checks the token validity
      Parameters:
      tokenId - - requested token id
      streamId - - id of the stream
      sessionId - - id of the current session
      type - - type of the token (play/publish)
      Returns:
      true or false
    • checkTimeBasedSubscriber

      boolean checkTimeBasedSubscriber(String subscriberId, String streamId, String sessionId, String subscriberCode, String type)
      Checks the time based token validity
      Parameters:
      subscriberId - - requested subscriberId
      streamId - - id of the stream
      sessionId - - id of the current session
      subscriberCode - - with TOTP generated code
      type - - or @link Subscriber#PUBLISH_TYPE or @link Subscriber#PLAY_TYPE
      Returns:
      true or false
    • checkJwtToken

      boolean checkJwtToken(String jwtTokenId, String streamId, String sessionId, String type)
      Checks the JWT token validity
      Parameters:
      jwtTokenId - - requested token id
      streamId - - id of the stream
      type - - type of the token (play/publish)
      Returns:
      true or false
    • isJwtTokenValid

      boolean isJwtTokenValid(@Nonnull String jwtTokenId, @Nonnull String tokenSecret, @Nonnull String streamId, @Nonnull String type)
      Check the JWT token if it's valid. It accepts the secret key to check the validity;
      Parameters:
      jwtTokenId -
      tokenSecret -
      streamId -
      type -
      Returns:
    • createToken

      Token createToken(String streamId, long exprireDate, String type, String roomId)
      creates token according to the provided parameters
      Parameters:
      streamId - - id of the requested stream for token creation
      exprireDate - - expire date of the token
      type - type of the token (play/publish)
      roomId - - id of the room for playing streams in the room
      Returns:
      token
    • createJwtToken

      Token createJwtToken(String streamId, long exprireDate, String type, String roomId)
      creates token according to the provided parameters
      Parameters:
      streamId - - id of the requested stream for token creation
      exprireDate - - expire date of the token (unix timestamp)
      type - type of the token (play/publish)
      roomId - - id of the room for playing streams in the room
      Returns:
      token
    • getAuthenticatedMap

      Map<String,String> getAuthenticatedMap()
      gets map of authenticated sessions
      Returns:
      list
    • getSubscriberAuthenticatedMap

      Map<String,String> getSubscriberAuthenticatedMap()
      gets map of authenticated subscriber sessions
      Returns:
      list