Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions sdkmanager/src/BaseClient.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
public class BaseClient
namespace Autodesk.SDKManager
{
private IAuthenticationProvider _authenticationProvider;

public IAuthenticationProvider AuthenticationProvider
public class BaseClient
{
get
{
return _authenticationProvider;
}
set
private IAuthenticationProvider _authenticationProvider;

public IAuthenticationProvider AuthenticationProvider
{
_authenticationProvider = value;
get
{
return _authenticationProvider;
}
set
{
_authenticationProvider = value;
}
}
}

public BaseClient(IAuthenticationProvider authenticationProvider)
{
if (authenticationProvider != null)
public BaseClient(IAuthenticationProvider authenticationProvider)
{
_authenticationProvider = authenticationProvider;
if (authenticationProvider != null)
{
_authenticationProvider = authenticationProvider;
}
}

}
}
7 changes: 5 additions & 2 deletions sdkmanager/src/IAuthenticationProvider.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
using System.Collections.Generic;
using System.Threading.Tasks;

public interface IAuthenticationProvider
namespace Autodesk.SDKManager
{
Task<string> GetAccessToken(IEnumerable<string> scopes = default);
public interface IAuthenticationProvider
{
Task<string> GetAccessToken(IEnumerable<string> scopes = default);
}
}
22 changes: 11 additions & 11 deletions sdkmanager/src/StaticAuthenticationProvider.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
using System.Collections.Generic;
using System.Threading.Tasks;

public class StaticAuthenticationProvider : IAuthenticationProvider
namespace Autodesk.SDKManager
{
private string _accessToken;

public StaticAuthenticationProvider(string accessToken)
public class StaticAuthenticationProvider : IAuthenticationProvider
{
_accessToken = accessToken;
}
private string _accessToken;

public StaticAuthenticationProvider(string accessToken)
{
_accessToken = accessToken;
}

public async Task<string> GetAccessToken(IEnumerable<string> scopes = default)
{
return _accessToken;
public async Task<string> GetAccessToken(IEnumerable<string> scopes = default)
{
return _accessToken;
}
}


}