Muhammed
11/11/2025, 3:05 PMInfisical.Sdk).
Issue 1: Service Token Authentication
- .NET 8
- Service Token format: <http://st.dev|st.dev>.xxx... (valid format, starts with st.dev)
- Token has Read permission for Development environment
- Project ID verified
- Result: Authentication fails β
Code:
csharp
var options = new ClientSettings
{
Auth = new AuthenticationOptions
{
UniversalAuth = new UniversalAuthMethod
{
ClientId = serviceToken,
ClientSecret = serviceToken
}
}
};
Issue 2: Machine Identity (Universal Auth)
- Created Machine Identity with Viewer role (Permanent)
- Added to project successfully
- ClientId and ClientSecret generated and verified in dashboard
- Error: "Machine Identity doesn't have permission to access environment" or similar auth failure
Code:
csharp
var options = new ClientSettings
{
Auth = new AuthenticationOptions
{
UniversalAuth = new UniversalAuthMethod
{
ClientId = "xxx...xxx", // Valid ClientId from dashboard
ClientSecret = "xxx...xxx" // Valid ClientSecret from dashboard
}
}
};
var secrets = await client.ListSecretsAsync(new ListSecretsOptions
{
ProjectId = projectId,
Environment = "dev",
SecretPath = "/"
});
What I've Verified:
β
Machine Identity is added to project with Viewer role
β
Role shows "Permanent" duration
β
ClientId and ClientSecret copied correctly from Universal Auth tab
β
Project ID is correct
β
Service Token is valid and has Read permission for dev environment
Questions:
1. What's the correct .NET SDK authentication pattern for Service Tokens?
2. Why would Machine Identity fail despite correct permissions in dashboard?
3. Do I need to explicitly grant environment-level access to Machine Identity somewhere?
4. Is there a working .NET SDK example with either authentication method?
Happy to provide more debugging info via DM or private channel if needed!
Thanks! πBillcountry Muriithi
11/12/2025, 6:46 AMMuhammed
11/12/2025, 11:12 AMBillcountry Muriithi
11/12/2025, 11:20 AMvar settings = new InfisicalSdkSettingsBuilder()
.WithHostUri("<http://localhost:8080>") // Optional. Will default to <https://app.infisical.com>
In your case it should be:
https://eu.infisical.comMuhammed
11/12/2025, 1:41 PMBillcountry Muriithi
11/12/2025, 4:04 PMMuhammed
11/26/2025, 9:53 AM