remove heath from code
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
public class Schemes
|
||||
{
|
||||
/// <summary>
|
||||
/// The heath scheme.
|
||||
/// The default scheme.
|
||||
/// </summary>
|
||||
public const string HeathScheme = "HeathScheme";
|
||||
public const string DefaultScheme = "DefaultScheme";
|
||||
|
||||
/// <summary>
|
||||
/// The azure scheme.
|
||||
|
||||
@@ -49,10 +49,10 @@ namespace Core.Thalos.Adapters.Common.Constants
|
||||
public const string AzureADTenantId = "B2C:TenantId";
|
||||
public const string AzureADClientId = "B2C:ClientId";
|
||||
public const string AzureADClientSecret = "B2C:ClientSecret";
|
||||
public const string HeathThalosAppAuthorizationUrl = "Swagger:AuthorizationUri";
|
||||
public const string HeathThalosAppTokenUrl = "Swagger:TokenUri";
|
||||
public const string HeathThalosAppClientId = "Swagger:ClientId";
|
||||
public const string HeathThalosAppScope = "Swagger:Scope";
|
||||
public const string ThalosAppAuthorizationUrl = "Swagger:AuthorizationUri";
|
||||
public const string ThalosAppTokenUrl = "Swagger:TokenUri";
|
||||
public const string ThalosAppClientId = "Swagger:ClientId";
|
||||
public const string ThalosAppScope = "Swagger:Scope";
|
||||
public const string PrivateKey = "B2C:JwtIssuerOptions:TokenPrivateKey";
|
||||
public const string PublicKey = "B2C:JwtIssuerOptions:TokenPublicKey";
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Core.Thalos.Adapters.Extensions
|
||||
throw new InvalidOperationException("JwtIssuerOptions are not configured correctly.");
|
||||
|
||||
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
|
||||
.AddJwtBearer(Schemes.HeathScheme, x =>
|
||||
.AddJwtBearer(Schemes.DefaultScheme, x =>
|
||||
{
|
||||
x.TokenValidationParameters = new TokenValidationParameters
|
||||
{
|
||||
|
||||
@@ -53,11 +53,11 @@ namespace Core.Thalos.Adapters.Extensions
|
||||
{
|
||||
AuthorizationCode = new OpenApiOAuthFlow
|
||||
{
|
||||
AuthorizationUrl = new Uri(authSettings.HeathThalosAppAuthorizationUrl ?? string.Empty),
|
||||
TokenUrl = new Uri(authSettings.HeathThalosAppTokenUrl ?? string.Empty),
|
||||
AuthorizationUrl = new Uri(authSettings.ThalosAppAuthorizationUrl ?? string.Empty),
|
||||
TokenUrl = new Uri(authSettings.ThalosAppTokenUrl ?? string.Empty),
|
||||
Scopes = new Dictionary<string, string>
|
||||
{
|
||||
{ authSettings.HeathThalosAppScope ?? string.Empty, "Access API as User" }
|
||||
{ authSettings.ThalosAppScope ?? string.Empty, "Access API as User" }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,7 +70,7 @@ namespace Core.Thalos.Adapters.Extensions
|
||||
{
|
||||
Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = "oauth2" }
|
||||
},
|
||||
new[] { authSettings.HeathThalosAppScope }
|
||||
new[] { authSettings.ThalosAppScope }
|
||||
}
|
||||
});
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace Core.Thalos.Adapters.Extensions
|
||||
app.UseSwaggerUI(options =>
|
||||
{
|
||||
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Custom Auth API with Azure AD v1");
|
||||
options.OAuthClientId(authSettings.HeathThalosAppClientId);
|
||||
options.OAuthClientId(authSettings.ThalosAppClientId);
|
||||
options.OAuthUsePkce();
|
||||
options.OAuthScopeSeparator(" ");
|
||||
});
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Core.Thalos.Adapters.Helpers
|
||||
throw new ArgumentException("The app configuration is missing");
|
||||
|
||||
options.Connect(new Uri(endpoint), new DefaultAzureCredential())
|
||||
.Select(KeyFilter.Any, "cerberos_common")
|
||||
.Select(KeyFilter.Any, "thalos_common")
|
||||
.Select(KeyFilter.Any, appConfigLabel);
|
||||
|
||||
options.ConfigureKeyVault(keyVaultOptions =>
|
||||
@@ -40,10 +40,10 @@ namespace Core.Thalos.Adapters.Helpers
|
||||
AzureADTenantId = builder.Configuration.GetSection(Secrets.AzureADTenantId).Value,
|
||||
AzureADClientId = builder.Configuration.GetSection(Secrets.AzureADClientId).Value,
|
||||
AzureADClientSecret = builder.Configuration.GetSection(Secrets.AzureADClientSecret).Value,
|
||||
HeathThalosAppAuthorizationUrl = builder.Configuration.GetSection(Secrets.HeathThalosAppAuthorizationUrl).Value,
|
||||
HeathThalosAppTokenUrl = builder.Configuration.GetSection(Secrets.HeathThalosAppTokenUrl).Value,
|
||||
HeathThalosAppClientId = builder.Configuration.GetSection(Secrets.HeathThalosAppClientId).Value,
|
||||
HeathThalosAppScope = builder.Configuration.GetSection(Secrets.HeathThalosAppScope).Value,
|
||||
ThalosAppAuthorizationUrl = builder.Configuration.GetSection(Secrets.ThalosAppAuthorizationUrl).Value,
|
||||
ThalosAppTokenUrl = builder.Configuration.GetSection(Secrets.ThalosAppTokenUrl).Value,
|
||||
ThalosAppClientId = builder.Configuration.GetSection(Secrets.ThalosAppClientId).Value,
|
||||
ThalosAppScope = builder.Configuration.GetSection(Secrets.ThalosAppScope).Value,
|
||||
PrivateKey = builder.Configuration.GetSection(Secrets.PrivateKey).Value,
|
||||
PublicKey = builder.Configuration.GetSection(Secrets.PublicKey).Value,
|
||||
};
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace Core.Thalos.Adapters.Helpers
|
||||
/// <returns>The private key.</returns>
|
||||
private RSACryptoServiceProvider GetPrivateKeyFromPemFile()
|
||||
{
|
||||
using (TextReader privateKeyTextReader = new StringReader(File.ReadAllText(Path.Combine(exeDirectory, "HeathPrivateKey.pem"))))
|
||||
using (TextReader privateKeyTextReader = new StringReader(File.ReadAllText(Path.Combine(exeDirectory, "PrivateKey.pem"))))
|
||||
{
|
||||
AsymmetricCipherKeyPair readKeyPair = (AsymmetricCipherKeyPair)new PemReader(privateKeyTextReader).ReadObject();
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Core.Thalos.Adapters.Helpers
|
||||
/// <returns>The public key.</returns>
|
||||
public RSACryptoServiceProvider GetPublicKeyFromPemFile()
|
||||
{
|
||||
using (TextReader publicKeyTextReader = new StringReader(File.ReadAllText(Path.Combine(exeDirectory, "HeathPublicKey.pem"))))
|
||||
using (TextReader publicKeyTextReader = new StringReader(File.ReadAllText(Path.Combine(exeDirectory, "PublicKey.pem"))))
|
||||
{
|
||||
RsaKeyParameters publicKeyParam = (RsaKeyParameters)new PemReader(publicKeyTextReader).ReadObject();
|
||||
|
||||
|
||||
@@ -12,11 +12,11 @@ public class AuthSettings
|
||||
public string? AzureADClientId { get; set; }
|
||||
public string? AzureADClientSecret { get; set; }
|
||||
|
||||
// Heath Thalos App Settings
|
||||
public string? HeathThalosAppAuthorizationUrl { get; set; }
|
||||
public string? HeathThalosAppTokenUrl { get; set; }
|
||||
public string? HeathThalosAppClientId { get; set; }
|
||||
public string? HeathThalosAppScope { get; set; }
|
||||
//Thalos App Settings
|
||||
public string? ThalosAppAuthorizationUrl { get; set; }
|
||||
public string? ThalosAppTokenUrl { get; set; }
|
||||
public string? ThalosAppClientId { get; set; }
|
||||
public string? ThalosAppScope { get; set; }
|
||||
|
||||
// Token Keys
|
||||
public string? PrivateKey { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user