Use auth context keys dedicated type instead of strings and avoid code duplication by moving shared code under a common package.