Functional custom authentication with more parameters. Now implement
correctly