Skip to content
Open
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
16 changes: 13 additions & 3 deletions src/libraries/Authentication/Authentication.Msal/MsalAuth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,12 @@
AssertionHelpers.ThrowIfNullOrWhiteSpace(agentAppInstanceId, nameof(agentAppInstanceId));
AssertionHelpers.ThrowIfNullOrWhiteSpace(agenticUserId, nameof(agenticUserId));

var cacheKey = $"{agentAppInstanceId}/{agenticUserId}/{string.Join(";", scopes)}";
string k1 = "";
if ( scopes != null )
{
k1 = string.Join(";", scopes);
}
var cacheKey = $"{agentAppInstanceId}/{upn}/{k1}";

Check failure on line 218 in src/libraries/Authentication/Authentication.Msal/MsalAuth.cs

View workflow job for this annotation

GitHub Actions / Analyze (actions)

The name 'upn' does not exist in the current context

Check failure on line 218 in src/libraries/Authentication/Authentication.Msal/MsalAuth.cs

View workflow job for this annotation

GitHub Actions / Analyze (actions)

The name 'upn' does not exist in the current context

Check failure on line 218 in src/libraries/Authentication/Authentication.Msal/MsalAuth.cs

View workflow job for this annotation

GitHub Actions / Analyze (actions)

The name 'upn' does not exist in the current context

Check failure on line 218 in src/libraries/Authentication/Authentication.Msal/MsalAuth.cs

View workflow job for this annotation

GitHub Actions / Analyze (actions)

The name 'upn' does not exist in the current context

Check failure on line 218 in src/libraries/Authentication/Authentication.Msal/MsalAuth.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The name 'upn' does not exist in the current context

Check failure on line 218 in src/libraries/Authentication/Authentication.Msal/MsalAuth.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The name 'upn' does not exist in the current context

Check failure on line 218 in src/libraries/Authentication/Authentication.Msal/MsalAuth.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The name 'upn' does not exist in the current context

Check failure on line 218 in src/libraries/Authentication/Authentication.Msal/MsalAuth.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The name 'upn' does not exist in the current context

Check failure on line 218 in src/libraries/Authentication/Authentication.Msal/MsalAuth.cs

View workflow job for this annotation

GitHub Actions / build

The name 'upn' does not exist in the current context

Check failure on line 218 in src/libraries/Authentication/Authentication.Msal/MsalAuth.cs

View workflow job for this annotation

GitHub Actions / build

The name 'upn' does not exist in the current context

Check failure on line 218 in src/libraries/Authentication/Authentication.Msal/MsalAuth.cs

View workflow job for this annotation

GitHub Actions / build

The name 'upn' does not exist in the current context

Check failure on line 218 in src/libraries/Authentication/Authentication.Msal/MsalAuth.cs

View workflow job for this annotation

GitHub Actions / build

The name 'upn' does not exist in the current context

Check failure on line 218 in src/libraries/Authentication/Authentication.Msal/MsalAuth.cs

View workflow job for this annotation

GitHub Actions / build

The name 'upn' does not exist in the current context

Check failure on line 218 in src/libraries/Authentication/Authentication.Msal/MsalAuth.cs

View workflow job for this annotation

GitHub Actions / build

The name 'upn' does not exist in the current context

Check failure on line 218 in src/libraries/Authentication/Authentication.Msal/MsalAuth.cs

View workflow job for this annotation

GitHub Actions / build

The name 'upn' does not exist in the current context

Check failure on line 218 in src/libraries/Authentication/Authentication.Msal/MsalAuth.cs

View workflow job for this annotation

GitHub Actions / build

The name 'upn' does not exist in the current context
var value = _agenticTokenCache.Get(cacheKey);
if (value != null)
{
Expand Down Expand Up @@ -250,11 +255,16 @@
var tokenEndpoint = _connectionSettings.Authority != null
? $"{_connectionSettings.Authority}/oauth2/v2.0/token"
: $"https://login.microsoftonline.com/{_connectionSettings.TenantId}/oauth2/v2.0/token";


string scp = "";
if (scopes != null)
{
scp = string.Join(" ", scopes);
}
var parameters = new Dictionary<string, string>
{
{ "client_id", agentAppInstanceId },
{ "scope", string.Join(" ", scopes) },
{ "scope", scp },
{ "client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer" },
{ "client_assertion", agentToken },
{ "user_id", agenticUserId },
Expand Down
Loading