예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RemoteRenderingClient" /> class.
        /// </summary>
        /// <param name="remoteRenderingEndpoint">The rendering service endpoint. This determines the region in which the rendering VM is created.</param>
        /// <param name="account">The Azure Remote Rendering account details.</param>
        /// <param name="credential">The credential used to access the Mixed Reality service.</param>
        /// <param name="options">The options.</param>
        public RemoteRenderingClient(Uri remoteRenderingEndpoint, RemoteRenderingAccount account, TokenCredential credential, RemoteRenderingClientOptions options = null)
        {
            Argument.AssertNotNull(account, nameof(account));
            Argument.AssertNotNull(credential, nameof(credential));

            options ??= new RemoteRenderingClientOptions();

            Uri             authenticationEndpoint = options.AuthenticationEndpoint ?? AuthenticationEndpoint.ConstructFromDomain(account.AccountDomain);
            TokenCredential mrTokenCredential      = MixedRealityTokenCredential.GetMixedRealityCredential(account.AccountId, authenticationEndpoint, credential);

            _accountId         = account.AccountId;
            _clientDiagnostics = new ClientDiagnostics(options);
            _pipeline          = HttpPipelineBuilder.Build(options, new BearerTokenAuthenticationPolicy(mrTokenCredential, GetDefaultScope(remoteRenderingEndpoint)));
            _restClient        = new RemoteRenderingRestClient(_clientDiagnostics, _pipeline, remoteRenderingEndpoint.ToString(), options.Version);
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RemoteRenderingClient" /> class.
 /// </summary>
 /// <param name="remoteRenderingEndpoint">The rendering service endpoint. This determines the region in which the rendering VM is created.</param>
 /// <param name="account">The Azure Remote Rendering account details.</param>
 /// <param name="keyCredential">The Azure Remote Rendering account primary or secondary key credential.</param>
 /// <param name="options">The options.</param>
 public RemoteRenderingClient(Uri remoteRenderingEndpoint, RemoteRenderingAccount account, AzureKeyCredential keyCredential, RemoteRenderingClientOptions options = null)
     : this(remoteRenderingEndpoint, account, new MixedRealityAccountKeyCredential(account.AccountId, keyCredential), options)
 {
 }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RemoteRenderingClient" /> class.
 /// </summary>
 /// <param name="remoteRenderingEndpoint">The rendering service endpoint. This determines the region in which the rendering VM is created.</param>
 /// <param name="account">The Azure Remote Rendering account details.</param>
 /// <param name="accessToken">An access token used to access the specified Azure Remote Rendering account.</param>
 /// <param name="options">The options.</param>
 public RemoteRenderingClient(Uri remoteRenderingEndpoint, RemoteRenderingAccount account, AccessToken accessToken, RemoteRenderingClientOptions options = null)
     : this(remoteRenderingEndpoint, account, new StaticAccessTokenCredential(accessToken), options)
 {
 }