private long getValidityPeriodForApplication(String consumerKey, OAuthAppDO oAuthAppBean) { long validityPeriodInMillis;// If the user is an application // Default Validity Period (in seconds) if (oAuthAppBean.getApplicationAccessTokenExpiryTime() != 0) { validityPeriodInMillis = oAuthAppBean.getApplicationAccessTokenExpiryTime() * SECONDS_TO_MILISECONDS_FACTOR; if (log.isDebugEnabled()) { log.debug("OAuth application id : " + consumerKey + ", application access token validity time in " + "milliseconds : " + validityPeriodInMillis); } } else { validityPeriodInMillis = OAuthServerConfiguration.getInstance() .getApplicationAccessTokenValidityPeriodInSeconds() * SECONDS_TO_MILISECONDS_FACTOR; } return validityPeriodInMillis; }
private void setValuesToStatementWithNoPKCEAndNoOwnerUpdate(OAuthAppDO oauthAppDO, PreparedStatement prepStmt) throws SQLException, IdentityOAuth2Exception { prepStmt.setLong(4, oauthAppDO.getUserAccessTokenExpiryTime()); prepStmt.setLong(5, oauthAppDO.getApplicationAccessTokenExpiryTime()); prepStmt.setLong(6, oauthAppDO.getRefreshTokenExpiryTime()); prepStmt.setLong(7, oauthAppDO.getIdTokenExpiryTime()); prepStmt.setString(8, persistenceProcessor.getProcessedClientId(oauthAppDO.getOauthConsumerKey())); }
private void setValuesToStatementWithPKCENoOwnerUpdate(OAuthAppDO oauthAppDO, PreparedStatement prepStmt) throws SQLException, IdentityOAuth2Exception { prepStmt.setString(4, oauthAppDO.isPkceMandatory() ? "1" : "0"); prepStmt.setString(5, oauthAppDO.isPkceSupportPlain() ? "1" : "0"); prepStmt.setLong(6, oauthAppDO.getUserAccessTokenExpiryTime()); prepStmt.setLong(7, oauthAppDO.getApplicationAccessTokenExpiryTime()); prepStmt.setLong(8, oauthAppDO.getRefreshTokenExpiryTime()); prepStmt.setLong(9, oauthAppDO.getIdTokenExpiryTime()); prepStmt.setString(10, persistenceProcessor.getProcessedClientId(oauthAppDO.getOauthConsumerKey())); }
private void setValuesToStatementWithOwnerUpdateNoPKCE(OAuthAppDO oauthAppDO, PreparedStatement prepStmt) throws SQLException, IdentityOAuth2Exception { prepStmt.setLong(4, oauthAppDO.getUserAccessTokenExpiryTime()); prepStmt.setLong(5, oauthAppDO.getApplicationAccessTokenExpiryTime()); prepStmt.setLong(6, oauthAppDO.getRefreshTokenExpiryTime()); prepStmt.setLong(7, oauthAppDO.getIdTokenExpiryTime()); prepStmt.setString(8, oauthAppDO.getAppOwner().getUserName()); prepStmt.setString(9, oauthAppDO.getAppOwner().getUserStoreDomain()); prepStmt.setString(10, persistenceProcessor.getProcessedClientId(oauthAppDO.getOauthConsumerKey())); }
private void setValuesToStatementWithPKCEAndOwnerUpdate(OAuthAppDO oauthAppDO, PreparedStatement prepStmt) throws SQLException, IdentityOAuth2Exception { prepStmt.setString(4, oauthAppDO.isPkceMandatory() ? "1" : "0"); prepStmt.setString(5, oauthAppDO.isPkceSupportPlain() ? "1" : "0"); prepStmt.setLong(6, oauthAppDO.getUserAccessTokenExpiryTime()); prepStmt.setLong(7, oauthAppDO.getApplicationAccessTokenExpiryTime()); prepStmt.setLong(8, oauthAppDO.getRefreshTokenExpiryTime()); prepStmt.setLong(9, oauthAppDO.getIdTokenExpiryTime()); prepStmt.setString(10, oauthAppDO.getAppOwner().getUserName()); prepStmt.setString(11, oauthAppDO.getAppOwner().getUserStoreDomain()); prepStmt.setString(12, persistenceProcessor.getProcessedClientId(oauthAppDO.getOauthConsumerKey())); }
private OAuthAppDO getoAuthApp(String consumerKey) throws IdentityOAuth2Exception { OAuthAppDO oAuthAppBean; try { oAuthAppBean = OAuth2Util.getAppInformationByClientId(consumerKey); if (log.isDebugEnabled()) { log.debug("Service Provider specific expiry time enabled for application : " + consumerKey + ". Application access token expiry time : " + oAuthAppBean.getApplicationAccessTokenExpiryTime() + ", User access token expiry time : " + oAuthAppBean.getUserAccessTokenExpiryTime() + ", Refresh token expiry time : " + oAuthAppBean.getRefreshTokenExpiryTime()); } } catch (InvalidOAuthClientException e) { throw new IdentityOAuth2Exception("Error while retrieving app information for clientId : " + consumerKey, e); } return oAuthAppBean; }
private static OAuthAppDO getOAuthApp(String consumerKey) throws IdentityOAuth2Exception { OAuthAppDO oAuthAppBean; try { oAuthAppBean = OAuth2Util.getAppInformationByClientId(consumerKey); if (log.isDebugEnabled()) { log.debug("Service Provider specific expiry time enabled for application : " + consumerKey + ". " + "Application access token expiry time : " + oAuthAppBean.getApplicationAccessTokenExpiryTime () + ", User access token expiry time : " + oAuthAppBean.getUserAccessTokenExpiryTime() + ", " + "" + "Refresh token expiry time : " + oAuthAppBean.getRefreshTokenExpiryTime()); } } catch (InvalidOAuthClientException e) { throw new IdentityOAuth2Exception("Error while retrieving app information for clientId : " + consumerKey, e); } return oAuthAppBean; }
private OAuthAppDO getOAuthApp(String clientId) throws IdentityOAuth2Exception { OAuthAppDO oAuthAppDO; try { oAuthAppDO = OAuth2Util.getAppInformationByClientId(clientId); } catch (InvalidOAuthClientException e) { throw new IdentityOAuth2Exception("Error while retrieving app information for clientId: " + clientId, e); } if (log.isDebugEnabled()) { log.debug("Service Provider specific expiry time enabled for application : " + clientId + ". Application access token expiry time : " + oAuthAppDO.getApplicationAccessTokenExpiryTime() + ", User access token expiry time : " + oAuthAppDO.getUserAccessTokenExpiryTime() + ", Refresh token expiry time : " + oAuthAppDO.getRefreshTokenExpiryTime()); } return oAuthAppDO; }
lifetimeInMillis = oAuthAppDO.getApplicationAccessTokenExpiryTime() * 1000; if (log.isDebugEnabled()) { log.debug("Application Access Token Life time set to : " + lifetimeInMillis + "ms.");
prepStmt.setString(11, consumerAppDO.isPkceSupportPlain() ? "1" : "0"); prepStmt.setLong(12, consumerAppDO.getUserAccessTokenExpiryTime()); prepStmt.setLong(13, consumerAppDO.getApplicationAccessTokenExpiryTime()); prepStmt.setLong(14, consumerAppDO.getRefreshTokenExpiryTime()); prepStmt.setLong(15, consumerAppDO.getIdTokenExpiryTime()); prepStmt.setString(9, consumerAppDO.getGrantTypes()); prepStmt.setLong(10, consumerAppDO.getUserAccessTokenExpiryTime()); prepStmt.setLong(11, consumerAppDO.getApplicationAccessTokenExpiryTime()); prepStmt.setLong(12, consumerAppDO.getRefreshTokenExpiryTime()); prepStmt.setLong(13, consumerAppDO.getIdTokenExpiryTime());
". Application access token expiry time : " + oAuthAppDO.getApplicationAccessTokenExpiryTime() + ", User access token expiry time : " + oAuthAppDO.getUserAccessTokenExpiryTime() + ", Refresh token expiry time : " + oAuthAppDO.getRefreshTokenExpiryTime());
dto.setPkceSupportPlain(appDO.isPkceSupportPlain()); dto.setUserAccessTokenExpiryTime(appDO.getUserAccessTokenExpiryTime()); dto.setApplicationAccessTokenExpiryTime(appDO.getApplicationAccessTokenExpiryTime()); dto.setRefreshTokenExpiryTime(appDO.getRefreshTokenExpiryTime()); dto.setIdTokenExpiryTime(appDO.getIdTokenExpiryTime());