Skip to content

Commit

Permalink
Fix #159. Client management endpoint should preserve the grace period…
Browse files Browse the repository at this point in the history
…, not zero it out (thereby disabling grace periods for any unwitting clients.)
  • Loading branch information
gaynor@illinois.edu authored and gaynor@illinois.edu committed Jan 26, 2024
1 parent 4218f00 commit 5402b77
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 91 deletions.
76 changes: 37 additions & 39 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -67,37 +67,7 @@ protected static void parseRawToken(String rawToken, TokenImpl token) {
return;

}
/*
StringTokenizer st = new StringTokenizer(rawToken, ".");
if (1 < st.countTokens() && st.countTokens() <= 3) {
st.nextToken();
String payload = st.nextToken();
try {
byte[] x = Base64.decodeBase64(payload);
String pp = new String(x, StandardCharsets.UTF_8);
JSONObject jsonObject = JSONObject.fromObject(pp);
token.setPayload(jsonObject);
// remember that in JWTs the times are in seconds.
if (jsonObject.containsKey("jti")) {
token.setJti(URI.create(jsonObject.getString("jti")));
}
if (jsonObject.containsKey("iat")) {
token.setIssuedAt(1000 * jsonObject.getLong("iat"));
}
if (jsonObject.containsKey("exp")) {
long expiresAt = jsonObject.getLong("exp");
token.setExpiresAt(1000 * expiresAt);
token.setLifetime(1000 * expiresAt - token.getIssuedAt());
}
token.setJWT(true);
token.setToken(rawToken);// can't really change this. Should be a string...
return;
} catch (Throwable t) {
// so it ain't a JWT.
t.printStackTrace();
}
}
*/

// so at this point, we have to assume that it is indeed just a token.
token.setJWT(false);
token.setJti(URI.create(rawToken));
Expand Down Expand Up @@ -145,6 +115,7 @@ public static RefreshTokenImpl createRT(String rawToken) {
return refreshToken;
}


/**
* Recreate the object from its serialized form.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public interface OA2Constants {
public static String MAX_ID_TOKEN_LIFETIME = "max_id_token_lifetime";
public static String ID_TOKEN_IDENTIFIER = "jti"; // was token_id
public static String EA_SUPPORT = "ea_support";

public static String REQUEST = "request";
public static String REQUEST_URI = "request_uri";
public static String AUTHORIZATION_TIME = "auth_time";
Expand Down
Loading

0 comments on commit 5402b77

Please sign in to comment.