Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,21 @@ public class DeviceCodeParameters : AuthenticationParameters

public string HomeAccountId { get; set; }

public string ClaimsChallenge { get; set; }

public DeviceCodeParameters(
PowerShellTokenCacheProvider tokenCacheProvider,
IAzureEnvironment environment,
IAzureTokenCache tokenCache,
string tenantId,
string resourceId,
string userId,
string homeAccountId) : base(tokenCacheProvider, environment, tokenCache, tenantId, resourceId)
string homeAccountId,
string claimsChallenge) : base(tokenCacheProvider, environment, tokenCache, tenantId, resourceId)
{
UserId = userId;
HomeAccountId = homeAccountId;
ClaimsChallenge = claimsChallenge;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ public class InteractiveParameters : DeviceCodeParameters
{
public Action<string> PromptAction { get; set; }

public string ClaimsChallenge { get; set; }

public InteractiveParameters(
PowerShellTokenCacheProvider tokenCacheProvider,
IAzureEnvironment environment,
Expand All @@ -32,10 +30,9 @@ public InteractiveParameters(
string userId,
string homeAccountId,
Action<string> promptAction,
string claimsChallenge) : base(tokenCacheProvider, environment, tokenCache, tenantId, resourceId, userId, homeAccountId)
string claimsChallenge) : base(tokenCacheProvider, environment, tokenCache, tenantId, resourceId, userId, homeAccountId, claimsChallenge)
{
PromptAction = promptAction;
ClaimsChallenge = claimsChallenge;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ public class InteractiveWamParameters : DeviceCodeParameters
{
public Action<string> PromptAction { get; set; }

public string ClaimsChallenge { get; set; }

public InteractiveWamParameters(
PowerShellTokenCacheProvider tokenCacheProvider,
IAzureEnvironment environment,
Expand All @@ -32,10 +30,9 @@ public InteractiveWamParameters(
string userId,
string homeAccountId,
Action<string> promptAction,
string claimsChallenge) : base(tokenCacheProvider, environment, tokenCache, tenantId, resourceId, userId, homeAccountId)
string claimsChallenge) : base(tokenCacheProvider, environment, tokenCache, tenantId, resourceId, userId, homeAccountId, claimsChallenge)
{
PromptAction = promptAction;
ClaimsChallenge = claimsChallenge;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ private AuthenticationParameters GetAuthenticationParameters(

if (account.IsPropertySet("UseDeviceAuth"))
{
return new DeviceCodeParameters(tokenCacheProvider, environment, tokenCache, tenant, resourceId, account.Id, homeAccountId);
return new DeviceCodeParameters(tokenCacheProvider, environment, tokenCache, tenant, resourceId, account.Id, homeAccountId, claimsChallenge);
}
else if (account.IsPropertySet(AzureAccount.Property.UsePasswordAuth))
{
Expand Down
3 changes: 2 additions & 1 deletion src/Accounts/Authenticators/DeviceCodeAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ public override Task<IAccessToken> Authenticate(AuthenticationParameters paramet
var scopes = AuthenticationHelpers.GetScope(onPremise, resource);
var clientId = Constants.PowerShellClientId;
var authority = parameters.Environment.ActiveDirectoryAuthority;
var claimsChallenge = deviceCodeParameters.ClaimsChallenge;

var requestContext = new TokenRequestContext(scopes, isCaeEnabled: true);
var requestContext = new TokenRequestContext(scopes, claims: claimsChallenge, isCaeEnabled: true);
DeviceCodeCredentialOptions options = new DeviceCodeCredentialOptions()
{
DeviceCodeCallback = DeviceCodeFunc,
Expand Down
Loading