/** * Update the scope validator of OAuth app by remove all the registered scope validators and then add as new entry. * * @param connection Same db connection used in OAuth update. * @param appId Id of consumerApp. * @param scopeValidators List of scope validators. * @throws SQLException Sql error. */ private void updateScopeValidators(Connection connection, int appId, String[] scopeValidators) throws SQLException { log.debug(String.format("Removing Scope validators registered for OAuth appId %d", appId)); try (PreparedStatement stmt = connection.prepareStatement(SQLQueries.OAuthAppDAOSQLQueries .REMOVE_APP_SCOPE_VALIDATORS)) { stmt.setInt(1, appId); stmt.execute(); } addScopeValidators(connection, appId, scopeValidators); }
addScopeValidators(connection, appId, consumerAppDO.getScopeValidators());