Skip to content

Commit 36a1f66

Browse files
committed
Add javadoc to Authentication and Delegation classes
1 parent 4895dff commit 36a1f66

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

core/src/main/java/com/auth0/authentication/Authentication.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030

3131
import static com.auth0.authentication.api.util.CheckHelper.checkArgument;
3232

33+
/**
34+
* The result of a successful authentication against Auth0
35+
* Contains the logged in user's {@link Token} and {@link UserProfile}
36+
*/
3337
public class Authentication {
3438

3539
private final UserProfile profile;

core/src/main/java/com/auth0/authentication/Delegation.java

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,21 @@
3030

3131
import 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)
3439
public 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

Comments
 (0)