microsoft/healthcare-shared-components

Public

mirrored from https://github.com/microsoft/healthcare-shared-componentsAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
main

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/Microsoft.Health.Client.UnitTests/TestCredentialProvider.cs

25lines · modepreview

// -------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
// -------------------------------------------------------------------------------------------------

using System.Threading;
using System.Threading.Tasks;
using Microsoft.Health.Client.Authentication;

namespace Microsoft.Health.Client.UnitTests;

internal sealed class TestCredentialProvider : CredentialProvider
{
    public TestCredentialProvider(string encodedToken = null)
    {
        EncodedToken = encodedToken;
    }

    public string EncodedToken { get; set; }

    protected override Task<string> BearerTokenFunction(CancellationToken cancellationToken)
    {
        return Task.FromResult(EncodedToken);
    }
}