Sad Tux - Windows bias detected
This page contains Windows bias

About This Page

This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.

Bias Analysis

Detected Bias Types
missing_linux_example
windows_tools
Summary
The documentation provides only a C# code example for generating the client secret JWT, which relies on Microsoft.IdentityModel.Tokens and CngKey (Windows-specific cryptography APIs). There are no examples or guidance for Linux users or for using cross-platform tools (such as OpenSSL, Python, or Node.js). This may make it difficult for developers working on non-Windows platforms to follow the instructions.
Recommendations
  • Add examples for generating and signing the JWT client secret using cross-platform tools such as OpenSSL, Python (e.g., PyJWT), or Node.js (e.g., jsonwebtoken).
  • Mention and provide code snippets for Linux/macOS environments, ensuring that users on those platforms can easily follow the steps.
  • Avoid relying solely on Windows-specific libraries (e.g., CngKey, ECDsaCng) in code samples; if C# is used, show alternatives that work on .NET Core/.NET 5+ on Linux.
  • Explicitly state that the process can be completed on any OS, and link to or reference platform-agnostic JWT generation resources.
GitHub Create Pull Request

Scan History

Date Scan Status Result
2026-01-14 00:00 #250 in_progress Biased Biased
2026-01-13 00:00 #246 completed Biased Biased
2026-01-12 00:00 #243 cancelled Biased Biased
2026-01-11 00:00 #240 completed Biased Biased
2026-01-10 00:00 #237 completed Biased Biased
2026-01-09 00:34 #234 completed Biased Biased
2026-01-08 00:53 #231 completed Clean Clean
2026-01-08 00:00 #228 cancelled Clean Clean
2026-01-06 18:15 #225 cancelled Clean Clean
2025-09-15 00:00 #112 completed Biased Biased
2025-09-14 00:00 #111 completed Clean Clean
2025-09-13 00:00 #110 completed Clean Clean
2025-09-12 00:00 #109 completed Clean Clean
2025-09-11 00:00 #108 completed Clean Clean
2025-09-10 00:00 #107 completed Clean Clean
2025-08-16 00:00 #82 cancelled Biased Biased
2025-08-15 00:01 #81 cancelled Biased Biased
2025-07-13 21:25 #47 cancelled Biased Biased
2025-07-13 20:48 #44 cancelled Biased Biased
2025-07-09 13:09 #3 cancelled Clean Clean
2025-07-08 04:23 #2 cancelled Biased Biased

Flagged Code Snippets

using Microsoft.IdentityModel.Tokens;

public static string GetAppleClientSecret(string teamId, string clientId, string keyId, string p8key)
{
    string audience = "https://appleid.apple.com";

    string issuer = teamId;
    string subject = clientId;
    string kid = keyId;

    IList<Claim> claims = new List<Claim> {
        new Claim ("sub", subject)
    };

    CngKey cngKey = CngKey.Import(Convert.FromBase64String(p8key), CngKeyBlobFormat.Pkcs8PrivateBlob);

    SigningCredentials signingCred = new SigningCredentials(
        new ECDsaSecurityKey(new ECDsaCng(cngKey)),
        SecurityAlgorithms.EcdsaSha256
    );

    JwtSecurityToken token = new JwtSecurityToken(
        issuer,
        audience,
        claims,
        DateTime.Now,
        DateTime.Now.AddDays(180),
        signingCred
    );
    token.Header.Add("kid", kid);
    token.Header.Remove("typ");

    JwtSecurityTokenHandler tokenHandler = new JwtSecurityTokenHandler();

    return tokenHandler.WriteToken(token);
}