mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-28 17:24:27 -05:00
Fix DacFx wizard not supporting AAD auth (#836)
* pass Azure authentication token if using AAD auth * add check for null
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using Microsoft.SqlServer.Dac;
|
||||
using System;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Utility
|
||||
{
|
||||
class AccessTokenProvider : IUniversalAuthProvider
|
||||
{
|
||||
private string _accessToken;
|
||||
|
||||
public AccessTokenProvider(string accessToken)
|
||||
{
|
||||
if (string.IsNullOrEmpty(accessToken))
|
||||
{
|
||||
throw new ArgumentNullException("accessToken");
|
||||
}
|
||||
|
||||
_accessToken = accessToken;
|
||||
}
|
||||
|
||||
public bool IsTokenExpired() { return false; }
|
||||
|
||||
public string GetValidAccessToken() { return _accessToken; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user