Class TokenEntity

java.lang.Object
com.ultikits.ultitools.entities.TokenEntity

@Deprecated(since="6.3.1", forRemoval=true) public class TokenEntity extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Use CloudAuthManager.login(DeviceLoginListener) for server linking; removed in 6.4.0.
Legacy user OAuth token, no longer issued or stored by UltiCloud protocol v2.
Scheduled removal version:
6.4.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    private String[]
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    private String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    private String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    private Long
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    private int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    private Long
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    private String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    private String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    private String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    private String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    private Long
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    private String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Decode the JWT payload from access_token and populate the fields.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the decoded payload information (for debugging).
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the token's expiration time.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the token's issued-at time.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the user ID as a string (for compatibility).
    boolean
    hasAuthority(String authority)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Check whether the user has the given authority.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Check whether the token has expired.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • access_token

      private String access_token
      Deprecated, for removal: This API element is subject to removal in a future version.
    • refresh_token

      private String refresh_token
      Deprecated, for removal: This API element is subject to removal in a future version.
    • token_type

      private String token_type
      Deprecated, for removal: This API element is subject to removal in a future version.
    • expires_in

      private int expires_in
      Deprecated, for removal: This API element is subject to removal in a future version.
    • scope

      private String scope
      Deprecated, for removal: This API element is subject to removal in a future version.
    • jti

      private String jti
      Deprecated, for removal: This API element is subject to removal in a future version.
    • user_id

      private Long user_id
      Deprecated, for removal: This API element is subject to removal in a future version.
    • user_name

      private String user_name
      Deprecated, for removal: This API element is subject to removal in a future version.
    • email

      private String email
      Deprecated, for removal: This API element is subject to removal in a future version.
    • authorities

      private String[] authorities
      Deprecated, for removal: This API element is subject to removal in a future version.
    • exp

      private Long exp
      Deprecated, for removal: This API element is subject to removal in a future version.
    • iat

      private Long iat
      Deprecated, for removal: This API element is subject to removal in a future version.
    • client_id

      private String client_id
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • TokenEntity

      public TokenEntity()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • decodeJwtPayload

      public void decodeJwtPayload()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Decode the JWT payload from access_token and populate the fields.
    • getDecodedInfo

      public String getDecodedInfo()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the decoded payload information (for debugging).
      Returns:
      a string containing the decoded information
    • isExpired

      public boolean isExpired()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Check whether the token has expired.
      Returns:
      true if expired, false if still valid
    • getExpirationDate

      public Date getExpirationDate()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the token's expiration time.
      Returns:
      the expiration time as a Date, or null if not set
    • getIssuedAt

      public Date getIssuedAt()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the token's issued-at time.
      Returns:
      the issued-at time as a Date, or null if not set
    • hasAuthority

      public boolean hasAuthority(String authority)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Check whether the user has the given authority.
      Parameters:
      authority - the authority to check
      Returns:
      true if the user has that authority, false otherwise
    • getUserIdAsString

      public String getUserIdAsString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the user ID as a string (for compatibility).
      Returns:
      the user ID as a string, or null if it is null