Exemple #1
0
        /// <summary>
        /// Sets the <see cref="ClaimsPrincipal"/> property.
        /// </summary>
        /// <param name="claimsPrincipal">The claims principal.</param>
        /// <returns>The <see cref="ITotpContactBuilder"/>.</returns>
        public ITotpMessageContentBuilder UsePrincipal(ClaimsPrincipal claimsPrincipal)
        {
            ClaimsPrincipal = claimsPrincipal ?? throw new ArgumentNullException($"Parameter {nameof(claimsPrincipal)} cannot be null.");
            var totpMessageContentBuilder = new TotpMessageContentBuilder(this);

            return(totpMessageContentBuilder);
        }
Exemple #2
0
        /// <summary>
        /// Sets the <see cref="SecurityToken"/> property.
        /// </summary>
        /// <param name="securityToken">Security token.</param>
        /// <returns>The <see cref="ITotpContactBuilder"/>.</returns>
        public ITotpMessageContentBuilder UseSecurityToken(string securityToken)
        {
            if (string.IsNullOrEmpty(securityToken))
            {
                throw new ArgumentNullException($"Parameter {nameof(securityToken)} cannot be null or empty.");
            }
            SecurityToken = securityToken;
            var totpMessageContentBuilder = new TotpMessageContentBuilder(this);

            return(totpMessageContentBuilder);
        }