bugfix: factory needs to return authentication provider as first parameter