LTPA2 Token

new available method: newLpta2Encoder

This API Service can be used to create LTPA2 tokens.

Parameters

  • privateKey : PrivateKey object : the private key to use, to sign the tokens.
  • secretKeyString : String : Base64 encoded shared symmetric key (AES) to use to encrypt the token.

Return Value

An LptaTokenEncoder object. Object that can be used to encode/decode and verify the signature of LTPA tokens, using the configured keys.

Method: decodeLTPAToken

decodeLTPAToken : method which decodes an encoded ltpa token string.

parameters

  • token : String : the encoded ltpa token String

return value : 

  • LtpaToken object

methods:

  • getExpire : long : expiry time in seconds since epoch
  • getHost : String
  • getLtpaVersion : LtpaVersion enum object
  • getNamingProvider : String
  • getPlainUserMetadata : String : the plain unencoded token String
  • getPort : int
  • getServerName : String
  • getType : String
  • getUser : String
  • getAuthenticationMethod : String
  • toString : String : the encoded token string

Method: encodeLTPAToken

parameters:

  • ltpaToken : LtpaToken object : to create an unsigned token, see ltpa2TokenBuilder() method

return value : 

  • String : encoded ltpa token string

Method: ltpa2TokenBuilder

return value : Token Builder object

usage example :

var token = builder.setUser("user\\:defaultWIMFileBasedRealm/uid=wpsadmin,o=defaultWIMFileBasedRealm")
                   .setAuthenticationMethod("authMethod")
                   .setExpire(1535545274)
                   .setHost("host")
                   .setNamingProvider("namingProvider")
                   .setPort(8484)
                   .setServerName("serverName")
                   .setType("type")
                   .build();
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.