Skip to content

Instantly share code, notes, and snippets.

@ArnauMrJeff
Last active September 7, 2020 16:00
Show Gist options
  • Save ArnauMrJeff/fe81cc73cb320f95b2c4e79995aec052 to your computer and use it in GitHub Desktop.
Save ArnauMrJeff/fe81cc73cb320f95b2c4e79995aec052 to your computer and use it in GitHub Desktop.
Apple ID Sign In: TokenResponse
import com.fasterxml.jackson.annotation.JsonProperty;
public final class TokenResponse {
private final String idToken;
private final String accessToken;
private final String tokenType;
private final Long expiresIn;
private final String refreshToken;
public TokenResponse(@JsonProperty("id_token") String idToken,
@JsonProperty("access_token") String accessToken,
@JsonProperty("token_type") String tokenType,
@JsonProperty("expires_in") Long expiresIn,
@JsonProperty("refresh_token") String refreshToken) {
this.idToken = idToken;
this.accessToken = accessToken;
this.tokenType = tokenType;
this.expiresIn = expiresIn;
this.refreshToken = refreshToken;
}
public String getIdToken() {
return idToken;
}
public String getAccessToken() {
return accessToken;
}
public String getTokenType() {
return tokenType;
}
public Long getExpiresIn() {
return expiresIn;
}
public String getRefreshToken() {
return refreshToken;
}
@Override
public String toString() {
return "TokenResponse{" +
"idToken='" + idToken + '\'' +
", accessToken='" + accessToken + '\'' +
", tokenType='" + tokenType + '\'' +
", expiresIn=" + expiresIn +
", refreshToken='" + refreshToken + '\'' +
'}';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment