Skip to content

Commit cc876df

Browse files
committed
Fixes to Azure AD auth
1 parent 6efabbd commit cc876df

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

TerraformRegistry/Models/OidcOptions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ public class OidcOptions
2121
{
2222
public string JwtSecretKey { get; set; } = string.Empty;
2323
public int JwtExpiryHours { get; set; } = 24;
24-
public Dictionary<string, OidcProviderOptions> Providers { get; set; } = new();
24+
public Dictionary<string, OidcProviderOptions> Providers { get; set; } =
25+
new(StringComparer.OrdinalIgnoreCase);
2526
}
2627

2728
/// <summary>

TerraformRegistry/Services/OAuthService.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,20 @@ public IEnumerable<OidcProviderInfo> GetEnabledProviders()
3838
if (!config.Enabled || string.IsNullOrEmpty(config.ClientId))
3939
continue;
4040

41+
var normalizedName = name.ToLowerInvariant();
4142
providers.Add(new OidcProviderInfo
4243
{
43-
Name = name.ToLowerInvariant(),
44-
DisplayName = name switch
44+
Name = normalizedName,
45+
DisplayName = normalizedName switch
4546
{
46-
"GitHub" => "GitHub",
47-
"AzureAD" => "Microsoft",
47+
"github" => "GitHub",
48+
"azuread" => "Azure AD",
4849
_ => name
4950
},
50-
Icon = name switch
51+
Icon = normalizedName switch
5152
{
52-
"GitHub" => "i-simple-icons-github",
53-
"AzureAD" => "i-simple-icons-microsoft",
53+
"github" => "i-simple-icons-github",
54+
"azuread" => "i-simple-icons-microsoft",
5455
_ => "i-lucide-key"
5556
}
5657
});

TerraformRegistry/web-src/pages/login.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
:disabled="isLoading"
4242
class="w-full justify-center font-medium"
4343
size="xl"
44-
:color="provider.name === 'github' ? 'neutral' : 'primary'"
44+
color="neutral"
4545
variant="solid"
4646
@click="handleOidcLogin(provider.name)"
4747
>

0 commit comments

Comments
 (0)