Interface AccessToken

  • All Superinterfaces:
    java.lang.Cloneable, PersistenceEntity

    public interface AccessToken
    extends PersistenceEntity
    Access Token for access control. An access token has a unique secure token id, and defines a list of access items and permissions. Each access item has a scope that is defined by a module. The scope for accessing an entity is its EntityTypeId.toString().
    Since:
    5.16
    • Field Detail

      • VERY_STRONG_SECURE_CODE_LEN

        static final int VERY_STRONG_SECURE_CODE_LEN
        Very strong secure code length. base64 string length, multiple of 4. number of bytes = base64StringLen * 3 / 4. 120 chars * 3 / 4 = 90 bytes (space: 2^720)
        Since:
        5.16
        See Also:
        Constant Field Values
      • STRONG_SECURE_CODE_LEN

        static final int STRONG_SECURE_CODE_LEN
        Strong secure code length. It can be used along with another code for maximum security. base64 string length, multiple of 4. number of bytes = base64StringLen * 3 / 4. 80 chars * 3 / 4 = 60 bytes (space: 2^480)
        Since:
        5.16
        See Also:
        Constant Field Values
      • PROPERTY_NAME

        static final java.lang.String PROPERTY_NAME
        Property: name
        See Also:
        Constant Field Values
      • PROPERTY_GUEST_TOKEN

        static final java.lang.String PROPERTY_GUEST_TOKEN
        Property: guestToken
        See Also:
        Constant Field Values
      • PROPERTY_TOKEN_NUMBER

        static final java.lang.String PROPERTY_TOKEN_NUMBER
        Property: tokenNumber
        See Also:
        Constant Field Values
      • PROPERTY_ACCESS_ITEMS

        static final java.lang.String PROPERTY_ACCESS_ITEMS
        Property: accessItems
        See Also:
        Constant Field Values
    • Method Detail

      • getName

        java.lang.String getName()
        Get token name
        Returns:
        name
      • setName

        void setName​(java.lang.String name)
        Set token name
        Parameters:
        name - token name
      • getGuestToken

        java.lang.Boolean getGuestToken()
        Is this token a gust token? if true, all guests (not authenticated) will automatically own this token and its associated permissions.
        Returns:
        true for guest token, false if user needs to be authorized using this token (name and number) to be granted corresponding permissions.
      • setGuestToken

        void setGuestToken​(java.lang.Boolean guestToken)
        Set whether this token is a gust token. If true, all guests (not authenticated) will automatically own this token and be granted to its associated permissions. Otherwise, user needs to be authorized using this token (name and number) to be granted corresponding permissions.
        Parameters:
        guestToken - true for guest token, false for non-guest token
      • getTokenNumber

        java.lang.String getTokenNumber()
        Get token number.
        Returns:
        token number
      • setTokenNumber

        void setTokenNumber​(java.lang.String tokenNumber)
        Set token number
        Parameters:
        tokenNumber - token number
      • getAccessItems

        java.util.List<AccessItem> getAccessItems()
        Get the list of access items for this token.
        Returns:
        access items
      • setAccessItems

        void setAccessItems​(java.util.List<AccessItem> accessItems)
        Set the list of access items for this token.
        Parameters:
        accessItems - a list of access items