/// <summary> /// Creates a new <see cref="AzureAuthority"/> with an optional authority host url. /// </summary> /// <param name="authorityHostUrl">Optional: sets a non-default authority host url.</param> public AzureAuthority(string authorityHostUrl = DefaultAuthorityHostUrl) { Debug.Assert(Uri.IsWellFormedUriString(authorityHostUrl, UriKind.Absolute), "The authorityHostUrl parameter is invalid."); AuthorityHostUrl = authorityHostUrl; _adalTokenCache = new VstsAdalTokenCache(); }
/// <summary> /// Creates a new <see cref="AzureAuthority"/> with an optional authority host url. /// </summary> /// <param name="authorityHostUrl">Optional: sets a non-default authority host url.</param> public AzureAuthority(string authorityHostUrl = DefaultAuthorityHostUrl) { if (String.IsNullOrEmpty(authorityHostUrl)) throw new ArgumentNullException(nameof(authorityHostUrl)); if (!Uri.IsWellFormedUriString(authorityHostUrl, UriKind.Absolute)) throw new ArgumentException(nameof(authorityHostUrl)); AuthorityHostUrl = authorityHostUrl; _adalTokenCache = new VstsAdalTokenCache(); }
/// <summary> /// Creates a new <see cref="AzureAuthority"/> with an optional authority host url. /// </summary> /// <param name="authorityHostUrl">Optional: sets a non-default authority host url.</param> public AzureAuthority(string authorityHostUrl = DefaultAuthorityHostUrl) { if (String.IsNullOrEmpty(authorityHostUrl)) { throw new ArgumentNullException(nameof(authorityHostUrl)); } if (!Uri.IsWellFormedUriString(authorityHostUrl, UriKind.Absolute)) { throw new ArgumentException(nameof(authorityHostUrl)); } AuthorityHostUrl = authorityHostUrl; _adalTokenCache = new VstsAdalTokenCache(); }
/// <summary> /// Creates a new instance of `<see cref="AzureAuthority"/>`. /// </summary> /// <param name="authorityHostUrl">A non-default authority host URL; otherwise defaults to `<see cref="DefaultAuthorityHostUrl"/>`.</param> public AzureAuthority(RuntimeContext context, string authorityHostUrl = DefaultAuthorityHostUrl) : base(context) { if (string.IsNullOrEmpty(authorityHostUrl)) { throw new ArgumentNullException(nameof(authorityHostUrl)); } if (!Uri.IsWellFormedUriString(authorityHostUrl, UriKind.Absolute)) { throw new ArgumentException("Uri is not Absolute.", nameof(authorityHostUrl)); } AuthorityHostUrl = authorityHostUrl; _adalTokenCache = new VstsAdalTokenCache(context); }