Mriesch extract oauth2server into factory

Extracting The creation code for the OAuth2Server into its own factory so that it can be reused.