Sehen Sie sich so etwas wie SimpleSAMLphp an Es ist eine großartige Bibliothek, um solche Dinge zu tun.