// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.AspNet.Security.OpenIdConnect;
using Microsoft.Framework.OptionsModel;
namespace Microsoft.AspNet.Builder
{
///
/// Extension methods for using
///
public static class OpenIdConnectAuthenticationExtensions
{
///
/// Adds the into the ASP.NET runtime.
///
/// The application builder
/// Options which control the processing of the OpenIdConnect protocol and token validation.
/// The application builder
public static IApplicationBuilder UseOpenIdConnectAuthentication(this IApplicationBuilder app, Action configureOptions = null, string optionsName = "")
{
return app.UseMiddleware(
new ConfigureOptions(configureOptions ?? (o => { }))
{
Name = optionsName
});
}
}
}