Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MixedRealityStsClient" /> class.
        /// </summary>
        /// <param name="accountId">The Mixed Reality service account identifier.</param>
        /// <param name="endpoint">The Mixed Reality STS service endpoint.</param>
        /// <param name="credential">The credential used to access the Mixed Reality service.</param>
        /// <param name="options">The options.</param>
        public MixedRealityStsClient(Guid accountId, Uri endpoint, TokenCredential credential, MixedRealityStsClientOptions options = null)
        {
            Argument.AssertNotDefault(ref accountId, nameof(accountId));
            Argument.AssertNotNull(endpoint, nameof(endpoint));
            Argument.AssertNotNull(credential, nameof(credential));

            options ??= new MixedRealityStsClientOptions();

            AccountId          = accountId;
            Endpoint           = endpoint;
            _clientDiagnostics = new ClientDiagnostics(options);
            _pipeline          = HttpPipelineBuilder.Build(options, new BearerTokenAuthenticationPolicy(credential, GetDefaultScope(endpoint)));
            _restClient        = new MixedRealityStsRestClient(_clientDiagnostics, _pipeline, endpoint, options.Version);
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MixedRealityStsClient" /> class.
 /// </summary>
 /// <param name="accountId">The Mixed Reality service account identifier.</param>
 /// <param name="endpoint">The Mixed Reality STS service endpoint.</param>
 /// <param name="keyCredential">The Mixed Reality service account primary or secondary key credential.</param>
 /// <param name="options">The options.</param>
 public MixedRealityStsClient(Guid accountId, Uri endpoint, AzureKeyCredential keyCredential, MixedRealityStsClientOptions options = null)
     : this(accountId, endpoint, new MixedRealityAccountKeyCredential(accountId, keyCredential), options)
 {
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MixedRealityStsClient" /> class.
 /// </summary>
 /// <param name="accountId">The Mixed Reality service account identifier.</param>
 /// <param name="accountDomain">The Mixed Reality service account domain.</param>
 /// <param name="credential">The credential used to access the Mixed Reality service.</param>
 /// <param name="options">The options.</param>
 public MixedRealityStsClient(Guid accountId, string accountDomain, TokenCredential credential, MixedRealityStsClientOptions options = null)
     : this(accountId, AuthenticationEndpoint.ConstructFromDomain(accountDomain), credential, options)
 {
 }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MixedRealityStsClient" /> class.
 /// </summary>
 /// <param name="accountId">The Mixed Reality service account identifier.</param>
 /// <param name="accountDomain">The Mixed Reality service account domain.</param>
 /// <param name="keyCredential">The Mixed Reality service account primary or secondary key credential.</param>
 /// <param name="options">The options.</param>
 public MixedRealityStsClient(Guid accountId, string accountDomain, AzureKeyCredential keyCredential, MixedRealityStsClientOptions options = null)
     : this(accountId, AuthenticationEndpoint.ConstructFromDomain(accountDomain), new MixedRealityAccountKeyCredential(accountId, keyCredential), options)
 {
 }