コード例 #1
0
        /// <summary>
        /// Creates a new instance of `<see cref="Authority"/>`.
        /// </summary>
        /// <param name="authorityHostUrl">A non-default authority host URL; otherwise defaults to `<see cref="DefaultAuthorityHostUrl"/>`.</param>
        public Authority(RuntimeContext context, string authorityHostUrl)
            : base(context)
        {
            if (string.IsNullOrEmpty(authorityHostUrl))
            {
                throw new ArgumentNullException(nameof(authorityHostUrl));
            }
            if (!Uri.IsWellFormedUriString(authorityHostUrl, UriKind.Absolute))
            {
                var inner = new UriFormatException("Authority host URL must be absolute.");
                throw new ArgumentException(inner.Message, nameof(authorityHostUrl), inner);
            }

            AuthorityHostUrl = authorityHostUrl;
            _adalTokenCache  = new AdalTokenCache(context);
        }
コード例 #2
0
 public Adal(Alm.RuntimeContext context)
     : base(context)
 {
     _cache = new AdalTokenCache(context);
 }