Skip to content

Removing unnecessary comments #219

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

Merged
merged 2 commits into from
Dec 3, 2019
Merged
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
6 changes: 0 additions & 6 deletions Microsoft.Identity.Web/WebApiServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,17 @@ public static IServiceCollection AddProtectedWebApi(
/// </summary>
/// <param name="services">Service collection to which to add authentication</param>
/// <param name="configuration">Configuration</param>
/// <param name="scopes">Optional parameters. If not specified, the token used to call the protected API
/// will be kept with the user's claims until the API calls a downstream API. Otherwise the account for the
/// user is immediately added to the token cache</param>
/// <returns></returns>
public static IServiceCollection AddProtectedApiCallsWebApis(
this IServiceCollection services,
IConfiguration configuration,
IEnumerable<string> scopes = null,
string configSectionName = "AzureAd")
{
services.AddTokenAcquisition();
services.AddHttpContextAccessor();
services.Configure<ConfidentialClientApplicationOptions>(options => configuration.Bind(configSectionName, options));
services.Configure<JwtBearerOptions>(AzureADDefaults.JwtBearerAuthenticationScheme, options =>
{
// If you don't pre-provide scopes when adding calling AddProtectedApiCallsWebApis, the On behalf of
// flow will be delayed (lazy construction of MSAL's application
options.Events.OnTokenValidated = async context =>
{
context.HttpContext.StoreTokenUsedToCallWebAPI(context.SecurityToken as JwtSecurityToken);
Expand Down