示例#1
0
        /// <summary>
        /// Illustrate how a recovery agent signs an authorization.
        /// </summary>
        /// <param name="authorization">client's claim to be some member</param>
        /// <returns>if authorization seems legitimate, return signature; else error</returns>
        public Signature GetRecoveryAgentSignature(MemberRecoveryOperation.Types.Authorization authorization)
        {
            // authorizeRecovery begin snippet to include in doc
            // "Remember" whether this person who claims to be member with
            // the ID m:12345678 really is:
            bool isCorrect = CheckMemberId(authorization.MemberId);

            if (isCorrect)
            {
                return(agentMember.AuthorizeRecoveryBlocking(authorization));
            }
            throw new ArgumentException("I don't authorize this");
            // authorizeRecovery done snippet to include in doc
        }