Also i believe in the community commons there is a Java Action called JA_Logoff that you can place in any microflow and it will log the user out right then and there.
This can be done with a custom java action.
Here is some documentation on java actions
Hope this helps!
Do note that from a page it can be much simpeler. Just drop a button and use the Sign out option in the On click events.