A close friend of the couple told the writer how Obama had explained that "the lines are very clearly drawn… If I am going out with a white woman, I have no standing here".

London - Barack Obama twice proposed to a girlfriend before he met Michelle, it emerged on Wednesday.

The ex-president is said to have kept on seeing Sheila Miyoshi Jager after he started a relationship with his future wife, a biography claims.

And he is said to have considered "gayness" but "decided that a same-sex relationship would be less challenging", according to bombshell claims in the book about his formative years.

In a hitherto unknown chapter of his life, Obama became besotted with New York academic Jager when they were in their early 20s.

But she twice turned down his marriage proposals and he eventually wed the then Michelle Robinson.

The revelations are contained in Rising Star: The Making Of Barack Obama, written by Pulitzer Prize-winning author David Garrow. The book says Obama met Jager in the mid-1980s when he was shaking off his middle-class, white upbringing by working as a black community organiser in Chicago.

They lived together in the city and were, in her words, an "island unto ourselves".

Jager, an anthropologist who has Dutch and Japanese ancestry, told Garrow Mr Obama had ambitions to be president even then, and had a "deep-seated need to be loved and admired".

She said he first proposed to her in 1986 on a visit to her family home in Manhattan.

However, her parents thought that, at 23, she was too young and she rejected him.

They stayed together, however, and Miss Jager – now a professor at Oberlin University – recalled the young Obama becoming "so very ambitious very suddenly".

A close friend of the couple told the writer how Obama had explained that "the lines are very clearly drawn… If I am going out with a white woman, I have no standing here".

While Obama cared for her, he "felt trapped between the woman he loved and the destiny he knew was his," said Garrow.

He proposed again before starting at Harvard Law School in 1988 and was again turned down.

She believed his proposal was "out of a sense of desperation over our eventual parting and not in any real faith in our future".

Although they split up, she later moved to Harvard and claims they continued to see each other on and off between 1991 and 1992.

By then, he was in a relationship with Michelle – "I always felt bad about it," Jager said.

Garrow alleges Obama’s relationships with his two girlfriends as "overlapping".

Jager told him that her revelations were "really, really sensitive" because "we did not go our separate ways after 1988," adding: "I do not think Michelle knows."

After the Obamas married, Barack exchanged occasional letters and a phone call with Jager when he wanted to know if a biographer had contacted her.

He later became an Illinois senator in the state capital of Springfield.

Infidelity was rife, said Garrow, but Obama refrained, telling a colleague: "Michelle would kick my butt."

Although he was heterosexual, Obama had flirted with "gayness", said Garrow.

In a chapter about his two years at Occidental College in Los Angeles, which he attended in 1979, Garrow reveals a close relationship he had with a gay assistant professor, Lawrence Goldyn.

Professor Goldyn – a witty character who wore yellow trousers and sandals – made a huge impact on Mr Obama and they developed a "friendship beyond the classroom", Garrow writes.

"Three years later, Obama wrote somewhat elusively to his first intimate girlfriend that he had thought about and considered gayness, but ultimately had decided that a same-sex relationship would be less challenging and demanding than developing one with the opposite sex."

As president, Obama credited Professor Goldyn as a profound influence on his views on gays and lesbians. Miss Jager was essentially written out of Mr Obama’s autobiography, Dreams from my Father. She was compressed with two other white girlfriends into one character in what critics saw as the author’s attempt to play down his preference for white lovers.

Garrow also alleges that Obama took cocaine longer than he has previously admitted.

Former Australian girlfriend Genevieve Cook, who slept with him on their first date in 1983 and wrote about their "passionate sex" in her diary, claims he was still using cocaine in his early 20s.

Garrow also claims Cook revealed that Mr Obama was sexually unimaginative but "quite earthy", adding: "He was no kind of shrinking 'Can’t handle it. This is invasive' or 'I’m timid' in any way."

She wrote in her diary: "Making love with Barack, so warm and flowing and soft but deep – relaxed and loving – opening up more."

Garrow, whose book will be published on May 9, concludes that while the president worked relentlessly to craft an image of himself that would get him elected, "the vessel was hollow at its core".