v2.2: Allows passing a Resource object as context
The authenticator now accepts a Resource object, in addition to a string or null, as authentication context. This allows for more complex and type-safe context information to be passed during authentication.