public static RefreshToken getRefreshToken(String refreshToken) throws JWSInputException { byte[] encodedContent = new JWSInput(refreshToken).getContent(); return getRefreshToken(encodedContent); }
protected void handleTestAvailable() { if (log.isTraceEnabled()) { log.trace("K_TEST_AVAILABLE sent"); } try { JWSInput token = verifyAdminRequest(); if (token == null) { return; } TestAvailabilityAction action = JsonSerialization.readValue(token.getContent(), TestAvailabilityAction.class); validateAction(action); } catch (Exception e) { throw new RuntimeException(e); } }
protected void handlePushNotBefore() { if (log.isTraceEnabled()) { log.trace("K_PUSH_NOT_BEFORE sent"); } try { JWSInput token = verifyAdminRequest(); if (token == null) { return; } PushNotBeforeAction action = JsonSerialization.readValue(token.getContent(), PushNotBeforeAction.class); if (!validateAction(action)) return; deployment.updateNotBefore(action.getNotBefore()); } catch (Exception e) { throw new RuntimeException(e); } }
action = JsonSerialization.readValue(token.getContent(), LogoutAction.class); } catch (IOException e) { throw new RuntimeException(e);
protected void handleLogout() { if (log.isTraceEnabled()) { log.trace("K_LOGOUT sent"); } try { JWSInput token = verifyAdminRequest(); if (token == null) { return; } LogoutAction action = JsonSerialization.readValue(token.getContent(), LogoutAction.class); if (!validateAction(action)) return; if (action.getAdapterSessionIds() != null) { userSessionManagement.logoutHttpSessions(action.getAdapterSessionIds()); } else { log.debugf("logout of all sessions for application '%s'", action.getResource()); if (action.getNotBefore() > deployment.getNotBefore()) { deployment.updateNotBefore(action.getNotBefore()); } userSessionManagement.logoutAll(); } } catch (Exception e) { throw new RuntimeException(e); } }
String refreshTokenValue = clientToken.getRefreshToken(); try { RefreshToken refreshToken = JsonSerialization.readValue(new JWSInput(refreshTokenValue).getContent(), RefreshToken.class); if (!refreshToken.isActive() || !isTokenTimeToLiveSufficient(refreshToken)) { log.debug("Refresh token is expired."); AccessToken accessToken = JsonSerialization.readValue(new JWSInput(token).getContent(), AccessToken.class);