File tree Expand file tree Collapse file tree 4 files changed +11
-7
lines changed
PowerDms.Api.Rest.Client/PowerDms.Api.Rest.Client Expand file tree Collapse file tree 4 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,16 @@ public class AuthenticationTokenProvider : IAuthenticationTokenProvider
9
9
{
10
10
private readonly OAuthClient _OAuthClient ;
11
11
12
+ private readonly string _OAuthClientSecret ;
13
+
12
14
private IDictionary < Credentials , string > _CachedCredentials ;
13
15
14
- public AuthenticationTokenProvider ( OAuthClient oAuthClient )
16
+ public AuthenticationTokenProvider (
17
+ OAuthClient oAuthClient ,
18
+ string oAuthClientSecret )
15
19
{
16
20
_OAuthClient = oAuthClient ;
21
+ _OAuthClientSecret = oAuthClientSecret ;
17
22
_CachedCredentials = new Dictionary < Credentials , string > ( ) ;
18
23
}
19
24
@@ -28,7 +33,7 @@ public async Task<string> GetAccessToken(Credentials credentials)
28
33
credentials . Username ,
29
34
credentials . Password ,
30
35
credentials . SiteKey ,
31
- credentials . ClientSecret
36
+ _OAuthClientSecret
32
37
) ) . GetContent < string > ( ) ;
33
38
}
34
39
}
Original file line number Diff line number Diff line change @@ -13,12 +13,12 @@ public class HttpRequestManager
13
13
private readonly IAuthenticationTokenProvider _AuthenticationTokenProvider ;
14
14
15
15
public HttpRequestManager (
16
- HttpClient httpClient )
16
+ HttpClient httpClient ,
17
+ AuthenticationTokenProvider authenticationTokenProvider )
17
18
{
18
19
_HttpClient = httpClient ;
19
20
PowerDmsRestApiClient = new PowerDmsRestApiClient ( httpClient ) ;
20
- _AuthenticationTokenProvider = new AuthenticationTokenProvider (
21
- PowerDmsRestApiClient . OAuth ) ;
21
+ _AuthenticationTokenProvider = authenticationTokenProvider ;
22
22
}
23
23
24
24
public async Task < HttpResponseMessage > SendAsync < T > ( HttpRequestBuilder < T > httpRequestBuilder )
Original file line number Diff line number Diff line change 9
9
</ItemGroup >
10
10
11
11
<ItemGroup >
12
- <ProjectReference Include =" ..\..\..\PowerDMS\tests\services\api\PowerDms.Api.Rest.Dtos\PowerDms.Api.Rest.Dtos.csproj" />
13
12
<ProjectReference Include =" ..\PowerDms.Api.Rest.Dto\PowerDms.Api.Rest.Dto.csproj" />
14
13
</ItemGroup >
15
14
Original file line number Diff line number Diff line change 2
2
{
3
3
public class RestApiRoutes
4
4
{
5
- public const string PowerDmsRestApiDomain = "api.powerdms.com" ;
5
+ public const string PowerDmsRestApiDomain = "https:// api.powerdms.com" ;
6
6
7
7
public const string Groups = "/principal/groups" ;
8
8
You can’t perform that action at this time.
0 commit comments