3030
3131import static com .auth0 .authentication .api .util .CheckHelper .checkArgument ;
3232
33+ /**
34+ * The result of a successful delegation to an Auth0 app.
35+ * Contains a new Auth0 'id_token' to be used on the 'target' app
36+ * See <a href="https://auth0.com/docs/auth-api#!#post--delegation">delegation</a> docs
37+ */
3338@ JsonIgnoreProperties (ignoreUnknown = true )
3439public class Delegation {
3540 private final String idToken ;
3641 private final String type ;
37- private final Integer expiresIn ;
42+ private final Long expiresIn ;
3843
3944 @ JsonCreator
4045 public Delegation (@ JsonProperty (value = "id_token" ) String idToken ,
4146 @ JsonProperty (value = "token_type" ) String type ,
42- @ JsonProperty (value = "expires_in" ) Integer expiresIn ) {
47+ @ JsonProperty (value = "expires_in" ) Long expiresIn ) {
4348 checkArgument (idToken != null , "id_token must be non-null" );
4449 checkArgument (type != null , "token_type must be non-null" );
4550 checkArgument (expiresIn != null , "expires_in must be non-null" );
@@ -48,15 +53,27 @@ public Delegation(@JsonProperty(value = "id_token") String idToken,
4853 this .expiresIn = expiresIn ;
4954 }
5055
56+ /**
57+ * Id token
58+ * @return the 'id_token' value
59+ */
5160 public String getIdToken () {
5261 return idToken ;
5362 }
5463
64+ /**
65+ * Token type
66+ * @return the 'token_type' value
67+ */
5568 public String getType () {
5669 return type ;
5770 }
5871
59- public Integer getExpiresIn () {
72+ /**
73+ * Token expire time in milliseconds since January 1, 1970, 00:00:00 GMT
74+ * @return the 'expires_in' value
75+ */
76+ public Long getExpiresIn () {
6077 return expiresIn ;
6178 }
6279}
0 commit comments