Skip to content

Commit 8414e48

Browse files
authored
Merge pull request #587 from aspnetboilerplate/pr/6048
change DefaultPassPhrase for every project
2 parents 207d134 + 06cd743 commit 8414e48

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

aspnet-core/src/AbpCompanyName.AbpProjectName.Application/AppConsts.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

aspnet-core/src/AbpCompanyName.AbpProjectName.Core/AbpProjectNameConsts.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,10 @@ public class AbpProjectNameConsts
77
public const string ConnectionStringName = "Default";
88

99
public const bool MultiTenancyEnabled = true;
10+
11+
/// <summary>
12+
/// Default pass phrase for SimpleStringCipher decrypt/encrypt operations
13+
/// </summary>
14+
public const string DefaultPassPhrase = "{{DEFAULT_PASS_PHRASE_HERE}}";
1015
}
1116
}

aspnet-core/src/AbpCompanyName.AbpProjectName.Core/AbpProjectNameCoreModule.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public override void PreInitialize()
3636
Configuration.Settings.Providers.Add<AppSettingProvider>();
3737

3838
Configuration.Localization.Languages.Add(new LanguageInfo("fa", "فارسی", "famfamfam-flags ir"));
39+
40+
Configuration.Settings.SettingEncryptionConfiguration.DefaultPassPhrase = AbpProjectNameConsts.DefaultPassPhrase;
3941
}
4042

4143
public override void Initialize()

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Core/Controllers/TokenAuthController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ private static List<Claim> CreateJwtClaims(ClaimsIdentity identity)
227227

228228
private string GetEncryptedAccessToken(string accessToken)
229229
{
230-
return SimpleStringCipher.Instance.Encrypt(accessToken, AppConsts.DefaultPassPhrase);
230+
return SimpleStringCipher.Instance.Encrypt(accessToken, AbpProjectNameConsts.DefaultPassPhrase);
231231
}
232232
}
233233
}

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Host/Startup/AuthConfigurer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ private static Task QueryStringTokenResolver(MessageReceivedContext context)
7171
}
7272

7373
// Set auth token from cookie
74-
context.Token = SimpleStringCipher.Instance.Decrypt(qsAuthToken, AppConsts.DefaultPassPhrase);
74+
context.Token = SimpleStringCipher.Instance.Decrypt(qsAuthToken, AbpProjectNameConsts.DefaultPassPhrase);
7575
return Task.CompletedTask;
7676
}
7777
}

0 commit comments

Comments
 (0)