-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ability to specify custom cookie options. Minor comment updates. #257
Conversation
src/Microsoft.Identity.Web/WebAppAuthenticationBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Web/WebApiCallsWebApiAuthenticationBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there any tests to be modified for this?
is it possible to do separate PRs for different issues (ex. moving the spelling fixes into a different PR in the future, makes it easier to review the current PR)?
b432033
to
965ac56
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few comments
|
||
var provider = services.BuildServiceProvider(); | ||
|
||
// Assert configure options actions added correctly | ||
var configuredOidcOptions = provider.GetServices<IConfigureOptions<OpenIdConnectOptions>>().Cast<ConfigureNamedOptions<OpenIdConnectOptions>>(); | ||
var configuredMsOptions = provider.GetServices<IConfigureOptions<MicrosoftIdentityOptions>>().Cast<ConfigureNamedOptions<MicrosoftIdentityOptions>>(); | ||
|
||
#if DOTNET_CORE_31 | ||
var configuredCookieOptions = provider.GetServices<IConfigureOptions<CookieAuthenticationOptions>>().Cast<ConfigureNamedOptions<CookieAuthenticationOptions>>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try to use IConfigureNamedOptions (interface) instead of an implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, but the service is of type IConfigureOptions
and interfaces don't have the Action
property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you see this, as an example? I would prefer to not have flags for .net 3.1/net 5 is possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, yea, I could just try to resolve the service for IConfigureOptions<CookieAuthenticationOptions>
but that will only tell us that some cookie options were added and not whether our custom cookie action was added.
We might still need flags in general, like for #234 fix.
unrelated to the change: this one is modified in a number of test cases, not sure how well this works with parallel test execution. Each test which needs something different should probably create a new options var. this was the only one I spotted, but glancing over the top of this file there might be more... thinking there should be an effort to explore parallel test execution (easy to enable in VS) issues. Not very important if things generally works and test execution is acceptable. Refers to: tests/Microsoft.Identity.Web.Test/WebAppExtensionsTests.cs:42 in 965ac56. [](commit_id = 965ac56, deletion_comment = False) |
@henrik-me |
f2afc9d
to
de614bd
Compare
ba57f3c
to
0ab9e84
Compare
Issue #237.