The United States Senate career of Barack Obama began on January 4, 2005 and ended on November 16, 2008.
Senator Sanders’ suggestion that President Obama should face a primary challenge was made in 2011. He stated that “what the president is doing” should be contrasted with “a progressive agenda.” Please note – At that point in time [2011], Mr. Obama was president.
In 2008, then Senator, Obama was less than half way through his first term in the US Senate and was not up for reelection. Thus, he could not face a primary challenge in 2008.
In 2008 the incumbent president was George W. Bush. He was nearing the end of his 2nd term as president and having been twice elected to that office was not eligible to seek a 3rd term. Thus, President Bush could not face a primary challenge from within his own party in 2008.
Like Barack Obama, Hillary Clinton (and others) sought the nomination of the Democratic Party in 2008 to stand in a general election to become president. Because the incumbent president was of a different political party and because none of the Democratic candidates were challenging a member of their own party for the nomination –
there was no primary challenge for the presidency in 2008.
After his failed attempts to become Vermont governor in 1972 and US senator for Vermont in 1976, Mr. Sanders resigned from the
Liberty Union Party in 1977. In 1980 he ran for Mayor of Burlington, Vermont as a member of the Progressive Party. He won that election by 10 votes.
In 1988, then Mayor, Sanders ran an unsuccessful campaign as an independent candidate for Vermont representative to the US House of Representatives. Two years later he ran again as an independent and won the sole congressional seat representing the State of Vermont. He served in that office for 16 years.
In 2005, then Representative, Sanders ran as an independent candidate and was successfully elected to the US Senate from the State of Vermont. He began his second 6-year term in that office in 2012 and remains in that office currently.
In 2015, Senator Sanders announced that he would seek the nomination of the Democratic Party to become president. In unison with that announcement, he also claimed his affiliation to the Democratic Party.
[Link]