コード例 #1
0
        public void PerformUserSecurityOperations(User user)
        {
            // authenticate user
            _authenticator.AuthenticateUser(user.UserName, user.Password);

            // authorize user
            bool canUserBeAuthorized = _authorizer.CanAuthorizeUser(user.UserName);

            if (canUserBeAuthorized)
            {
                _authorizer.AuthorizeUser(user.UserName);
            }
        }
コード例 #2
0
        public string GetUserRole(string tokenId)
        {
            var userId = _authenticator.AuthenticateWithFirebase(tokenId);

            return(_authorizer.AuthorizeUser(userId));
        }