.github/skills/msal-client-credentials/SKILL.md
Client Credentials Flow for service-to-service (daemon) authentication in MSAL.NET without user involvement
npx skillsauth add azuread/microsoft-authentication-library-for-dotnet msal-client-credentialsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Client Credentials Flow is used for service-to-service authentication without user involvement. Ideal for daemon applications and background services.
Agent can show code for each credential type:
Reference appropriate credential setup:
// Acquire token for service-to-service authentication
public class TokenAcquisitionService
{
private readonly IConfidentialClientApplication _app;
public TokenAcquisitionService(string clientId, X509Certificate2 cert)
{
// For complete example with static token caching, see: with-certificate.cs
_app = ConfidentialClientApplicationBuilder
.Create(clientId)
.WithCertificate(cert)
.WithAuthority($"https://login.microsoftonline.com/{tenantId}/v2.0")
.WithCacheOptions(CacheOptions.EnableSharedCacheOptions) // Enable static token caching
.Build();
}
public async Task<string> GetAccessTokenAsync()
{
var result = await _app.AcquireTokenForClient(
new[] { "resource-uri" })
.ExecuteAsync();
return result.AccessToken;
}
}
Refer to Troubleshooting Guide
.WithCacheOptions(CacheOptions.EnableSharedCacheOptions) for optimal performanceAuthenticationResultMetadata for cache hit ratiosChoose Client Credentials if:
Avoid if:
tools
Authorization Code Flow for web applications using MSAL.NET confidential client to sign in users and access APIs on their behalf
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------