Update Security to account for DataProtector API changes.
This commit is contained in:
parent
9e2f992479
commit
2e65a40555
|
|
@ -13,7 +13,8 @@ namespace Microsoft.AspNet.Security.DataProtection
|
|||
{
|
||||
if (dataProtectionProvider == null)
|
||||
{
|
||||
dataProtectionProvider = DataProtectionProvider.CreateFromDpapi();
|
||||
// TODO: Get this from the environment.
|
||||
dataProtectionProvider = new EphemeralDataProtectionProvider();
|
||||
}
|
||||
|
||||
return dataProtectionProvider.CreateProtector(string.Join(";", purposes));
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ namespace Microsoft.AspNet.Security.Google
|
|||
[Fact]
|
||||
public async Task ReplyPathWillAuthenticateValidAuthorizeCodeAndState()
|
||||
{
|
||||
ISecureDataFormat<AuthenticationProperties> stateFormat = new PropertiesDataFormat(DataProtectionProvider.CreateNew().CreateProtector("GoogleTest"));
|
||||
ISecureDataFormat<AuthenticationProperties> stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("GoogleTest"));
|
||||
var server = CreateServer(options =>
|
||||
{
|
||||
options.ClientId = "Test Id";
|
||||
|
|
@ -289,7 +289,7 @@ namespace Microsoft.AspNet.Security.Google
|
|||
[Fact]
|
||||
public async Task ReplyPathWillRejectIfCodeIsInvalid()
|
||||
{
|
||||
ISecureDataFormat<AuthenticationProperties> stateFormat = new PropertiesDataFormat(DataProtectionProvider.CreateNew().CreateProtector("GoogleTest"));
|
||||
ISecureDataFormat<AuthenticationProperties> stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("GoogleTest"));
|
||||
var server = CreateServer(options =>
|
||||
{
|
||||
options.ClientId = "Test Id";
|
||||
|
|
@ -319,7 +319,7 @@ namespace Microsoft.AspNet.Security.Google
|
|||
[Fact]
|
||||
public async Task ReplyPathWillRejectIfAccessTokenIsMissing()
|
||||
{
|
||||
ISecureDataFormat<AuthenticationProperties> stateFormat = new PropertiesDataFormat(DataProtectionProvider.CreateNew().CreateProtector("GoogleTest"));
|
||||
ISecureDataFormat<AuthenticationProperties> stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("GoogleTest"));
|
||||
var server = CreateServer(options =>
|
||||
{
|
||||
options.ClientId = "Test Id";
|
||||
|
|
@ -349,7 +349,7 @@ namespace Microsoft.AspNet.Security.Google
|
|||
[Fact]
|
||||
public async Task AuthenticatedEventCanGetRefreshToken()
|
||||
{
|
||||
ISecureDataFormat<AuthenticationProperties> stateFormat = new PropertiesDataFormat(DataProtectionProvider.CreateNew().CreateProtector("GoogleTest"));
|
||||
ISecureDataFormat<AuthenticationProperties> stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("GoogleTest"));
|
||||
var server = CreateServer(options =>
|
||||
{
|
||||
options.ClientId = "Test Id";
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ namespace Microsoft.AspNet.Security.Tests.MicrosoftAccount
|
|||
[Fact]
|
||||
public async Task AuthenticatedEventCanGetRefreshToken()
|
||||
{
|
||||
ISecureDataFormat<AuthenticationProperties> stateFormat = new PropertiesDataFormat(DataProtectionProvider.CreateNew().CreateProtector("MsftTest"));
|
||||
ISecureDataFormat<AuthenticationProperties> stateFormat = new PropertiesDataFormat(new EphemeralDataProtectionProvider().CreateProtector("MsftTest"));
|
||||
var server = CreateServer(
|
||||
options =>
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue