Promote SaveTokensAsClaims to RemoteAuthOptions

This commit is contained in:
Hao Kung 2015-12-07 13:37:56 -08:00
parent 17072b1417
commit f24c35f1a9
7 changed files with 8 additions and 26 deletions

View File

@ -24,7 +24,6 @@ namespace Microsoft.AspNet.Authentication.Facebook
AuthorizationEndpoint = FacebookDefaults.AuthorizationEndpoint;
TokenEndpoint = FacebookDefaults.TokenEndpoint;
UserInformationEndpoint = FacebookDefaults.UserInformationEndpoint;
SaveTokensAsClaims = false;
Fields = new List<string>();
}

View File

@ -22,7 +22,6 @@ namespace Microsoft.AspNet.Authentication.Google
AuthorizationEndpoint = GoogleDefaults.AuthorizationEndpoint;
TokenEndpoint = GoogleDefaults.TokenEndpoint;
UserInformationEndpoint = GoogleDefaults.UserInformationEndpoint;
SaveTokensAsClaims = false;
}
/// <summary>

View File

@ -22,7 +22,6 @@ namespace Microsoft.AspNet.Authentication.MicrosoftAccount
AuthorizationEndpoint = MicrosoftAccountDefaults.AuthorizationEndpoint;
TokenEndpoint = MicrosoftAccountDefaults.TokenEndpoint;
UserInformationEndpoint = MicrosoftAccountDefaults.UserInformationEndpoint;
SaveTokensAsClaims = false;
}
}
}

View File

@ -64,13 +64,5 @@ namespace Microsoft.AspNet.Authentication.OAuth
/// Gets or sets the type used to secure data handled by the middleware.
/// </summary>
public ISecureDataFormat<AuthenticationProperties> StateDataFormat { get; set; }
/// <summary>
/// Defines whether access and refresh tokens should be stored in the
/// <see cref="ClaimsPrincipal"/> after a successful authentication.
/// You can set this property to <c>false</c> to reduce the size of the final
/// authentication cookie. Note that social providers set this property to <c>false</c> by default.
/// </summary>
public bool SaveTokensAsClaims { get; set; } = true;
}
}

View File

@ -189,12 +189,5 @@ namespace Microsoft.AspNet.Authentication.OpenIdConnect
/// This is disabled by default.
/// </summary>
public bool UseTokenLifetime { get; set; }
/// <summary>
/// Defines whether access and refresh tokens should be stored in the
/// <see cref="ClaimsPrincipal"/> after a successful authentication.
/// You can set this property to <c>false</c> to reduce the size of the final authentication cookie.
/// </summary>
public bool SaveTokensAsClaims { get; set; } = true;
}
}

View File

@ -49,13 +49,5 @@ namespace Microsoft.AspNet.Authentication.Twitter
get { return (ITwitterEvents)base.Events; }
set { base.Events = value; }
}
/// <summary>
/// Defines whether access tokens should be stored in the
/// <see cref="ClaimsPrincipal"/> after a successful authentication.
/// This property is set to <c>false</c> by default to reduce
/// the size of the final authentication cookie.
/// </summary>
public bool SaveTokensAsClaims { get; set; }
}
}

View File

@ -48,6 +48,14 @@ namespace Microsoft.AspNet.Authentication
set { Description.DisplayName = value; }
}
/// <summary>
/// Defines whether access and refresh tokens should be stored in the
/// <see cref="ClaimsPrincipal"/> after a successful authentication.
/// This property is set to <c>false</c> by default to reduce
/// the size of the final authentication cookie.
/// </summary>
public bool SaveTokensAsClaims { get; set; }
public IRemoteAuthenticationEvents Events = new RemoteAuthenticationEvents();
}
}