Token authentication and authorization implementation.