Abstracted WS-Federation code from the plugins