Skip to content

Client Capabilities support#1641

Merged
bgavrilMS merged 6 commits intomasterfrom
bogavril/cl_cap
Feb 21, 2020
Merged

Client Capabilities support#1641
bgavrilMS merged 6 commits intomasterfrom
bogavril/cl_cap

Conversation

@bgavrilMS
Copy link
Copy Markdown
Member

Feature spec - #1545

Still need to find a way to end to end test this.

Known bug (will fix separately) - #1639

return (T)this;
}

/// <summary>
Copy link
Copy Markdown
Member Author

@bgavrilMS bgavrilMS Feb 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmprieur to review public API

Comment thread src/client/Microsoft.Identity.Client/MsalError.cs Outdated
@jennyf19
Copy link
Copy Markdown
Contributor

using System;

header info


Refers to: src/client/Microsoft.Identity.Client/Internal/ClaimsHelper.cs:1 in 07a6828. [](commit_id = 07a6828, deletion_comment = False)

Comment thread src/client/Microsoft.Identity.Client/Internal/ClaimsHelper.cs
Copy link
Copy Markdown
Contributor

@jennyf19 jennyf19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Comment thread src/client/Microsoft.Identity.Client/AppConfig/AbstractApplicationBuilder.cs Outdated
Comment thread src/client/Microsoft.Identity.Client/Internal/ClaimsHelper.cs Outdated
}
}

ClaimsAndClientCapabilities = ClaimsHelper.MergeClaimsAndClientCapabilities(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the ClaimsAndClientCapabilities be renamed to Claims? Do I understand correctly that capabilities are passed in a claims request, so they are a special type of a claim? So in this context normal claims and capabilities are both request claims. Also what if in the future a new type of claim is added, then having a generic Claims collection would be more representative? MergeClaimsAndClientCapabilities and WithClientCapabilities method names, I think, are good because they describe the specific separate collections.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a valid observation Peter. I was preparing for the fix #1639, where claims and client capabilities are treated differently in that:

  • if claims are specified, we need to bypass the token cache (because cached Access Tokens do not have enough claims)
  • but not for client capabilities

Comment thread src/client/Microsoft.Identity.Client/MsalError.cs Outdated
Comment thread src/client/Microsoft.Identity.Client/MsalErrorMessage.cs Outdated
Comment thread src/client/Microsoft.Identity.Client/MsalErrorMessage.cs Outdated
Comment thread tests/Microsoft.Identity.Test.Common/TestConstants.cs Outdated
Comment thread tests/Microsoft.Identity.Test.Unit.net45/CoreTests/OAuth2Tests/ClaimsTest.cs Outdated
Copy link
Copy Markdown
Contributor

@jmprieur jmprieur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @bgavrilMS
I've left a comment about the XML Comment, which, from my perspective, we could improve to state the value for the developer.
Can we have examples of such client capabilities and how the client will react?

On another side, we also have a claims request backlog item (Epic 789600: Claims request parameter support in MSAL). Do I understand that we are doing it as well?

}

/// <summary>
/// Microsoft Identity specific OIDC extension that allows resource challenges to be resolved without interaction.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Microsoft Identity specific OIDC extension that allows resource challenges to be resolved without interaction.
I don't understand what this means.

Do we want to say something like:
enables client applications to advertise to the Microsoft identity platform endpoint that they are capable of handling some specific fields and behaviors, and therefore the response to acquire token can be more elaborated?

public string ClientVersion { get; set; }

/// <summary>
/// Microsoft Identity specific OIDC extension that allows resource challenges to be resolved without interaction.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing.

.Create(s_clientIdForPublicApp)
.WithAuthority(GetAuthority())
.WithLogging(Log, LogLevel.Verbose, true)
//.WithClientCapabilities(new[] { "llt" })
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to keep this comment?

logger.InfoPii(messageWithPii, builder.ToString());
}

}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extra line above

Copy link
Copy Markdown
Member

@trwalke trwalke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit pick but the current state looks good

Copy link
Copy Markdown
Contributor

@jmprieur jmprieur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants