fix: Conversion logic for expires in field (#12781)
This commit is contained in:
parent
6e63290477
commit
e36b352a42
|
|
@ -142,9 +142,9 @@ public class OAuth2AuthorizationCode extends APIConnection implements UpdatableC
|
||||||
Object expiresInResponse = mappedResponse.get(Authentication.EXPIRES_IN);
|
Object expiresInResponse = mappedResponse.get(Authentication.EXPIRES_IN);
|
||||||
Instant expiresAt = null;
|
Instant expiresAt = null;
|
||||||
if (expiresAtResponse != null) {
|
if (expiresAtResponse != null) {
|
||||||
expiresAt = Instant.ofEpochSecond(Long.valueOf((Integer) expiresAtResponse));
|
expiresAt = Instant.ofEpochSecond(Long.parseLong(String.valueOf(expiresAtResponse)));
|
||||||
} else if (expiresInResponse != null) {
|
} else if (expiresInResponse != null) {
|
||||||
expiresAt = issuedAt.plusSeconds(Long.valueOf((Integer) expiresInResponse));
|
expiresAt = issuedAt.plusSeconds(Long.parseLong(String.valueOf(expiresInResponse)));
|
||||||
}
|
}
|
||||||
authenticationResponse.setExpiresAt(expiresAt);
|
authenticationResponse.setExpiresAt(expiresAt);
|
||||||
authenticationResponse.setIssuedAt(issuedAt);
|
authenticationResponse.setIssuedAt(issuedAt);
|
||||||
|
|
|
||||||
|
|
@ -111,9 +111,9 @@ public class OAuth2ClientCredentials extends APIConnection implements UpdatableC
|
||||||
Object expiresInResponse = mappedResponse.get(Authentication.EXPIRES_IN);
|
Object expiresInResponse = mappedResponse.get(Authentication.EXPIRES_IN);
|
||||||
Instant expiresAt = null;
|
Instant expiresAt = null;
|
||||||
if (expiresAtResponse != null) {
|
if (expiresAtResponse != null) {
|
||||||
expiresAt = Instant.ofEpochSecond(Long.parseLong((String) expiresAtResponse));
|
expiresAt = Instant.ofEpochSecond(Long.parseLong(String.valueOf(expiresAtResponse)));
|
||||||
} else if (expiresInResponse != null) {
|
} else if (expiresInResponse != null) {
|
||||||
expiresAt = issuedAt.plusSeconds(Long.valueOf((Integer) expiresInResponse));
|
expiresAt = issuedAt.plusSeconds(Long.parseLong(String.valueOf(expiresInResponse)));
|
||||||
}
|
}
|
||||||
authenticationResponse.setExpiresAt(expiresAt);
|
authenticationResponse.setExpiresAt(expiresAt);
|
||||||
authenticationResponse.setIssuedAt(issuedAt);
|
authenticationResponse.setIssuedAt(issuedAt);
|
||||||
|
|
|
||||||
|
|
@ -230,9 +230,9 @@ public class AuthenticationServiceCEImpl implements AuthenticationServiceCE {
|
||||||
Object expiresInResponse = response.get(Authentication.EXPIRES_IN);
|
Object expiresInResponse = response.get(Authentication.EXPIRES_IN);
|
||||||
Instant expiresAt = null;
|
Instant expiresAt = null;
|
||||||
if (expiresAtResponse != null) {
|
if (expiresAtResponse != null) {
|
||||||
expiresAt = Instant.ofEpochSecond(Long.valueOf((Integer) expiresAtResponse));
|
expiresAt = Instant.ofEpochSecond(Long.parseLong(String.valueOf(expiresAtResponse)));
|
||||||
} else if (expiresInResponse != null) {
|
} else if (expiresInResponse != null) {
|
||||||
expiresAt = issuedAt.plusSeconds(Long.parseLong((String) expiresInResponse));
|
expiresAt = issuedAt.plusSeconds(Long.parseLong(String.valueOf(expiresInResponse)));
|
||||||
}
|
}
|
||||||
authenticationResponse.setExpiresAt(expiresAt);
|
authenticationResponse.setExpiresAt(expiresAt);
|
||||||
// Replacing with returned scope instead
|
// Replacing with returned scope instead
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user