Handle IBuilder rename to IApplicationBuilder.
This commit is contained in:
parent
13adde63fa
commit
51c3dc98dc
|
|
@ -7,7 +7,7 @@ namespace CookieSample
|
|||
{
|
||||
public class Startup
|
||||
{
|
||||
public void Configure(IBuilder app)
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
app.UseCookieAuthentication(new CookieAuthenticationOptions()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace CookieSample
|
|||
{
|
||||
public class Startup
|
||||
{
|
||||
public void Configure(IBuilder app)
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
app.UseErrorPage();
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ namespace Microsoft.AspNet.Builder
|
|||
/// <summary>
|
||||
/// Adds a cookie-based authentication middleware to your web application pipeline.
|
||||
/// </summary>
|
||||
/// <param name="app">The IBuilder passed to your configuration method</param>
|
||||
/// <param name="app">The IApplicationBuilder passed to your configuration method</param>
|
||||
/// <param name="options">An options class that controls the middleware behavior</param>
|
||||
/// <returns>The original app parameter</returns>
|
||||
public static IBuilder UseCookieAuthentication([NotNull] this IBuilder app, [NotNull] CookieAuthenticationOptions options)
|
||||
public static IApplicationBuilder UseCookieAuthentication([NotNull] this IApplicationBuilder app, [NotNull] CookieAuthenticationOptions options)
|
||||
{
|
||||
return app.UseMiddleware<CookieAuthenticationMiddleware>(options);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ namespace Microsoft.AspNet.Security.Cookies
|
|||
/// <summary>
|
||||
/// The TicketDataFormat is used to protect and unprotect the identity and other properties which are stored in the
|
||||
/// cookie value. If it is not provided a default data handler is created using the data protection service contained
|
||||
/// in the IBuilder.Properties. The default data protection service is based on machine key when running on ASP.NET,
|
||||
/// in the IApplicationBuilder.Properties. The default data protection service is based on machine key when running on ASP.NET,
|
||||
/// and on DPAPI when running in a different process.
|
||||
/// </summary>
|
||||
public ISecureDataFormat<AuthenticationTicket> TicketDataFormat { get; set; }
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@ namespace Microsoft.AspNet.Builder
|
|||
/// <summary>
|
||||
/// Authenticate users using Facebook.
|
||||
/// </summary>
|
||||
/// <param name="app">The <see cref="IBuilder"/> passed to the configure method.</param>
|
||||
/// <param name="app">The <see cref="IApplicationBuilder"/> passed to the configure method.</param>
|
||||
/// <param name="appId">The appId assigned by Facebook.</param>
|
||||
/// <param name="appSecret">The appSecret assigned by Facebook.</param>
|
||||
/// <returns>The updated <see cref="IBuilder"/>.</returns>
|
||||
public static IBuilder UseFacebookAuthentication([NotNull] this IBuilder app, [NotNull] string appId, [NotNull] string appSecret)
|
||||
/// <returns>The updated <see cref="IApplicationBuilder"/>.</returns>
|
||||
public static IApplicationBuilder UseFacebookAuthentication([NotNull] this IApplicationBuilder app, [NotNull] string appId, [NotNull] string appSecret)
|
||||
{
|
||||
return app.UseFacebookAuthentication(new FacebookAuthenticationOptions()
|
||||
{
|
||||
|
|
@ -29,10 +29,10 @@ namespace Microsoft.AspNet.Builder
|
|||
/// <summary>
|
||||
/// Authenticate users using Facebook.
|
||||
/// </summary>
|
||||
/// <param name="app">The <see cref="IBuilder"/> passed to the configure method.</param>
|
||||
/// <param name="app">The <see cref="IApplicationBuilder"/> passed to the configure method.</param>
|
||||
/// <param name="options">The middleware configuration options.</param>
|
||||
/// <returns>The updated <see cref="IBuilder"/>.</returns>
|
||||
public static IBuilder UseFacebookAuthentication([NotNull] this IBuilder app, [NotNull] FacebookAuthenticationOptions options)
|
||||
/// <returns>The updated <see cref="IApplicationBuilder"/>.</returns>
|
||||
public static IApplicationBuilder UseFacebookAuthentication([NotNull] this IApplicationBuilder app, [NotNull] FacebookAuthenticationOptions options)
|
||||
{
|
||||
if (string.IsNullOrEmpty(options.SignInAsAuthenticationType))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@ namespace Microsoft.AspNet.Builder
|
|||
/// <summary>
|
||||
/// Authenticate users using Google OAuth 2.0.
|
||||
/// </summary>
|
||||
/// <param name="app">The <see cref="IBuilder"/> passed to the configure method.</param>
|
||||
/// <param name="app">The <see cref="IApplicationBuilder"/> passed to the configure method.</param>
|
||||
/// <param name="clientId">The google assigned client id.</param>
|
||||
/// <param name="clientSecret">The google assigned client secret.</param>
|
||||
/// <returns>The updated <see cref="IBuilder"/>.</returns>
|
||||
public static IBuilder UseGoogleAuthentication([NotNull] this IBuilder app, [NotNull] string clientId, [NotNull] string clientSecret)
|
||||
/// <returns>The updated <see cref="IApplicationBuilder"/>.</returns>
|
||||
public static IApplicationBuilder UseGoogleAuthentication([NotNull] this IApplicationBuilder app, [NotNull] string clientId, [NotNull] string clientSecret)
|
||||
{
|
||||
return app.UseGoogleAuthentication(
|
||||
new GoogleAuthenticationOptions
|
||||
|
|
@ -30,10 +30,10 @@ namespace Microsoft.AspNet.Builder
|
|||
/// <summary>
|
||||
/// Authenticate users using Google OAuth 2.0.
|
||||
/// </summary>
|
||||
/// <param name="app">The <see cref="IBuilder"/> passed to the configure method.</param>
|
||||
/// <param name="app">The <see cref="IApplicationBuilder"/> passed to the configure method.</param>
|
||||
/// <param name="options">Middleware configuration options.</param>
|
||||
/// <returns>The updated <see cref="IBuilder"/>.</returns>
|
||||
public static IBuilder UseGoogleAuthentication([NotNull] this IBuilder app, [NotNull] GoogleAuthenticationOptions options)
|
||||
/// <returns>The updated <see cref="IApplicationBuilder"/>.</returns>
|
||||
public static IApplicationBuilder UseGoogleAuthentication([NotNull] this IApplicationBuilder app, [NotNull] GoogleAuthenticationOptions options)
|
||||
{
|
||||
if (string.IsNullOrEmpty(options.SignInAsAuthenticationType))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@ namespace Microsoft.AspNet.Builder
|
|||
/// <summary>
|
||||
/// Authenticate users using Microsoft Account.
|
||||
/// </summary>
|
||||
/// <param name="app">The <see cref="IBuilder"/> passed to the configure method.</param>
|
||||
/// <param name="app">The <see cref="IApplicationBuilder"/> passed to the configure method.</param>
|
||||
/// <param name="clientId">The application client ID assigned by the Microsoft authentication service.</param>
|
||||
/// <param name="clientSecret">The application client secret assigned by the Microsoft authentication service.</param>
|
||||
/// <returns>The updated <see cref="IBuilder"/>.</returns>
|
||||
public static IBuilder UseMicrosoftAccountAuthentication([NotNull] this IBuilder app, [NotNull] string clientId, [NotNull] string clientSecret)
|
||||
/// <returns>The updated <see cref="IApplicationBuilder"/>.</returns>
|
||||
public static IApplicationBuilder UseMicrosoftAccountAuthentication([NotNull] this IApplicationBuilder app, [NotNull] string clientId, [NotNull] string clientSecret)
|
||||
{
|
||||
return app.UseMicrosoftAccountAuthentication(
|
||||
new MicrosoftAccountAuthenticationOptions
|
||||
|
|
@ -30,10 +30,10 @@ namespace Microsoft.AspNet.Builder
|
|||
/// <summary>
|
||||
/// Authenticate users using Microsoft Account.
|
||||
/// </summary>
|
||||
/// <param name="app">The <see cref="IBuilder"/> passed to the configure method.</param>
|
||||
/// <param name="app">The <see cref="IApplicationBuilder"/> passed to the configure method.</param>
|
||||
/// <param name="options">The middleware configuration options.</param>
|
||||
/// <returns>The updated <see cref="IBuilder"/>.</returns>
|
||||
public static IBuilder UseMicrosoftAccountAuthentication([NotNull] this IBuilder app, [NotNull] MicrosoftAccountAuthenticationOptions options)
|
||||
/// <returns>The updated <see cref="IApplicationBuilder"/>.</returns>
|
||||
public static IApplicationBuilder UseMicrosoftAccountAuthentication([NotNull] this IApplicationBuilder app, [NotNull] MicrosoftAccountAuthenticationOptions options)
|
||||
{
|
||||
if (string.IsNullOrEmpty(options.SignInAsAuthenticationType))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@ namespace Microsoft.AspNet.Builder
|
|||
/// <summary>
|
||||
/// Authenticate users using OAuth.
|
||||
/// </summary>
|
||||
/// <param name="app">The <see cref="IBuilder"/> passed to the configure method.</param>
|
||||
/// <param name="app">The <see cref="IApplicationBuilder"/> passed to the configure method.</param>
|
||||
/// <param name="options">The middleware configuration options.</param>
|
||||
/// <returns>The updated <see cref="IBuilder"/>.</returns>
|
||||
public static IBuilder UseOAuthAuthentication([NotNull] this IBuilder app, [NotNull] OAuthAuthenticationOptions<IOAuthAuthenticationNotifications> options)
|
||||
/// <returns>The updated <see cref="IApplicationBuilder"/>.</returns>
|
||||
public static IApplicationBuilder UseOAuthAuthentication([NotNull] this IApplicationBuilder app, [NotNull] OAuthAuthenticationOptions<IOAuthAuthenticationNotifications> options)
|
||||
{
|
||||
if (string.IsNullOrEmpty(options.SignInAsAuthenticationType))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@ namespace Microsoft.AspNet.Builder
|
|||
/// <summary>
|
||||
/// Authenticate users using Twitter
|
||||
/// </summary>
|
||||
/// <param name="app">The <see cref="IBuilder"/> passed to the configure method</param>
|
||||
/// <param name="app">The <see cref="IApplicationBuilder"/> passed to the configure method</param>
|
||||
/// <param name="consumerKey">The Twitter-issued consumer key</param>
|
||||
/// <param name="consumerSecret">The Twitter-issued consumer secret</param>
|
||||
/// <returns>The updated <see cref="IBuilder"/></returns>
|
||||
public static IBuilder UseTwitterAuthentication([NotNull] this IBuilder app, [NotNull] string consumerKey, [NotNull] string consumerSecret)
|
||||
/// <returns>The updated <see cref="IApplicationBuilder"/></returns>
|
||||
public static IApplicationBuilder UseTwitterAuthentication([NotNull] this IApplicationBuilder app, [NotNull] string consumerKey, [NotNull] string consumerSecret)
|
||||
{
|
||||
return app.UseTwitterAuthentication(
|
||||
new TwitterAuthenticationOptions
|
||||
|
|
@ -30,10 +30,10 @@ namespace Microsoft.AspNet.Builder
|
|||
/// <summary>
|
||||
/// Authenticate users using Twitter
|
||||
/// </summary>
|
||||
/// <param name="app">The <see cref="IBuilder"/> passed to the configure method</param>
|
||||
/// <param name="app">The <see cref="IApplicationBuilder"/> passed to the configure method</param>
|
||||
/// <param name="options">Middleware configuration options</param>
|
||||
/// <returns>The updated <see cref="IBuilder"/></returns>
|
||||
public static IBuilder UseTwitterAuthentication([NotNull] this IBuilder app, [NotNull] TwitterAuthenticationOptions options)
|
||||
/// <returns>The updated <see cref="IApplicationBuilder"/></returns>
|
||||
public static IApplicationBuilder UseTwitterAuthentication([NotNull] this IApplicationBuilder app, [NotNull] TwitterAuthenticationOptions options)
|
||||
{
|
||||
if (string.IsNullOrEmpty(options.SignInAsAuthenticationType))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace Microsoft.AspNet.Builder
|
|||
/// </summary>
|
||||
/// <param name="app">App builder passed to the application startup code</param>
|
||||
/// <returns></returns>
|
||||
public static string GetDefaultSignInAsAuthenticationType([NotNull] this IBuilder app)
|
||||
public static string GetDefaultSignInAsAuthenticationType([NotNull] this IApplicationBuilder app)
|
||||
{
|
||||
object value;
|
||||
if (app.Properties.TryGetValue(Constants.DefaultSignInAsAuthenticationType, out value))
|
||||
|
|
@ -37,7 +37,7 @@ namespace Microsoft.AspNet.Builder
|
|||
/// </summary>
|
||||
/// <param name="app">App builder passed to the application startup code</param>
|
||||
/// <param name="authenticationType">AuthenticationType that external middleware should sign in as.</param>
|
||||
public static void SetDefaultSignInAsAuthenticationType([NotNull] this IBuilder app, [NotNull] string authenticationType)
|
||||
public static void SetDefaultSignInAsAuthenticationType([NotNull] this IApplicationBuilder app, [NotNull] string authenticationType)
|
||||
{
|
||||
app.Properties[Constants.DefaultSignInAsAuthenticationType] = authenticationType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ namespace Microsoft.AspNet.Security {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The default data protection provider may only be used when the IBuilder.Properties contains an appropriate 'host.AppName' key..
|
||||
/// Looks up a localized string similar to The default data protection provider may only be used when the IApplicationBuilder.Properties contains an appropriate 'host.AppName' key..
|
||||
/// </summary>
|
||||
internal static string Exception_DefaultDpapiRequiresAppNameKey {
|
||||
get {
|
||||
|
|
@ -79,7 +79,7 @@ namespace Microsoft.AspNet.Security {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to A default value for SignInAsAuthenticationType was not found in IBuilder Properties. This can happen if your authentication middleware are added in the wrong order, or if one is missing..
|
||||
/// Looks up a localized string similar to A default value for SignInAsAuthenticationType was not found in IApplicationBuilder Properties. This can happen if your authentication middleware are added in the wrong order, or if one is missing..
|
||||
/// </summary>
|
||||
internal static string Exception_MissingDefaultSignInAsAuthenticationType {
|
||||
get {
|
||||
|
|
|
|||
|
|
@ -118,13 +118,13 @@
|
|||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Exception_DefaultDpapiRequiresAppNameKey" xml:space="preserve">
|
||||
<value>The default data protection provider may only be used when the IBuilder.Properties contains an appropriate 'host.AppName' key.</value>
|
||||
<value>The default data protection provider may only be used when the IApplicationBuilder.Properties contains an appropriate 'host.AppName' key.</value>
|
||||
</data>
|
||||
<data name="Exception_UnhookAuthenticationStateType" xml:space="preserve">
|
||||
<value>The state passed to UnhookAuthentication may only be the return value from HookAuthentication.</value>
|
||||
</data>
|
||||
<data name="Exception_MissingDefaultSignInAsAuthenticationType" xml:space="preserve">
|
||||
<value>A default value for SignInAsAuthenticationType was not found in IBuilder Properties. This can happen if your authentication middleware are added in the wrong order, or if one is missing.</value>
|
||||
<value>A default value for SignInAsAuthenticationType was not found in IApplicationBuilder Properties. This can happen if your authentication middleware are added in the wrong order, or if one is missing.</value>
|
||||
</data>
|
||||
<data name="Exception_AuthenticationTokenDoesNotProvideSyncMethods" xml:space="preserve">
|
||||
<value>The AuthenticationTokenProvider's required synchronous events have not been registered.</value>
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ namespace Microsoft.AspNet.Security.Facebook
|
|||
location.ShouldContain("state=");
|
||||
}
|
||||
|
||||
private static TestServer CreateServer(Action<IBuilder> configure, Func<HttpContext, bool> handler)
|
||||
private static TestServer CreateServer(Action<IApplicationBuilder> configure, Func<HttpContext, bool> handler)
|
||||
{
|
||||
return TestServer.Create(app =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ namespace Microsoft.AspNet.Security.Tests.MicrosoftAccount
|
|||
transaction.FindClaimValue("RefreshToken").ShouldBe("Test Refresh Token");
|
||||
}
|
||||
|
||||
private static TestServer CreateServer(Action<IBuilder> configure, Func<HttpContext, bool> handler)
|
||||
private static TestServer CreateServer(Action<IApplicationBuilder> configure, Func<HttpContext, bool> handler)
|
||||
{
|
||||
return TestServer.Create(app =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ namespace Microsoft.AspNet.Security.Twitter
|
|||
location.ShouldContain("https://twitter.com/oauth/authenticate?oauth_token=");
|
||||
}
|
||||
|
||||
private static TestServer CreateServer(Action<IBuilder> configure, Func<HttpContext, bool> handler)
|
||||
private static TestServer CreateServer(Action<IApplicationBuilder> configure, Func<HttpContext, bool> handler)
|
||||
{
|
||||
return TestServer.Create(app =>
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue