Refugees have been flooding into Germany. Under German law do these refugees have a path to citizenship? Or if their situation is temporary would they be expected to leave the country when asked?
German asylum law is codified in the "Gesetz über den Aufenthalt, die Erwerbstätigkeit und die Integration von Ausländern im Bundesgebiet" (English translation: "Act on the Residence, Economic Activity and Integration of Foreigners in the Federal Territory Residence Act"), or short AufenthG. The paragraphs in this answer all apply to this law unless noted otherwise. This is a very, very long and complex law and the explanations here are grossly oversimplified. I am not a lawyer. This is all my personal interpretation of the laws as a layman. When you want to know it exactly, please read the full law or ask a lawyer to explain it.
A foreigner who requests asylum in Germany has permission to stay in the country until their request for asylum has been processed (§25).
When the request is denied (for example, because they come from a country considered safe or because there is insufficient evidence that they are in danger in their home-country), they become illegal immigrants and will have to leave the country as soon as possible (§50), if necessary by force (§58). The foreigner can even be imprisoned until a deportation is possible (§62).
When the request is accepted, they get a time-limited permission to stay in the country for up to 3 years (§26) which can be extended for another 2 years afterwards. During that extension process it is reconfirmed if they still are in danger in their home-country. When the situation has changed, the extension might not get granted and they have to leave the country.
When the asylum extension was granted, the refugee can apply for a permanent settlement permit. Such a permit allows the foreigner to stay in Germany indefinitely. However, this does not make them a German citizen yet.
To become a German citizen with full access to social security, a German passport, voting rights etc., a foreigner needs not only a permanent settlement permit but also to go through the process of "Einbürgerung" (naturalization) according to § 10 Staatsangehörigkeitsgesetz (Nationality Act). There are several personal requirements for this, like living in Germany for several years, having a permanent employment, not committing any crimes and also passing a written citizenship test.