Add logout support to server and iam sample