Add authentication scope.

closes #3982
- Set custom key to use in localStorage based on subdir
Merge pull request #3994 from halfdan/3982-use-auth-scope

Add authentication scope.