microsoft/healthcare-shared-components

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
1.0.0-1.0.79

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/Microsoft.Health.Client/OAuth2ClientCredentialConfiguration.cs

42lines · modecode

1// -------------------------------------------------------------------------------------------------
2// Copyright (c) Microsoft Corporation. All rights reserved.
3// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
4// -------------------------------------------------------------------------------------------------
5
6using System;
7using EnsureThat;
8
9namespace Microsoft.Health.Client
10{
11 public class OAuth2ClientCredentialConfiguration
12 {
13 public OAuth2ClientCredentialConfiguration()
14 {
15 }
16
17 public OAuth2ClientCredentialConfiguration(Uri tokenUri, string resource, string scope, string clientId, string clientSecret)
18 {
19 EnsureArg.IsNotNull(tokenUri, nameof(tokenUri));
20 EnsureArg.IsNotNullOrWhiteSpace(resource, nameof(resource));
21 EnsureArg.IsNotNullOrWhiteSpace(scope, nameof(scope));
22 EnsureArg.IsNotNullOrWhiteSpace(clientId, nameof(clientId));
23 EnsureArg.IsNotNullOrWhiteSpace(clientSecret, nameof(clientSecret));
24
25 TokenUri = tokenUri;
26 Resource = resource;
27 Scope = scope;
28 ClientId = clientId;
29 ClientSecret = clientSecret;
30 }
31
32 public Uri TokenUri { get; set; }
33
34 public string Resource { get; set; }
35
36 public string Scope { get; set; }
37
38 public string ClientId { get; set; }
39
40 public string ClientSecret { get; set; }
41 }
42}
43