원클릭으로
msal-client-credentials
Client Credentials Flow for service-to-service (daemon) authentication in MSAL.NET without user involvement
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Client Credentials Flow for service-to-service (daemon) authentication in MSAL.NET without user involvement
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Authorization Code Flow for web applications using MSAL.NET confidential client to sign in users and access APIs on their behalf
On-Behalf-Of (OBO) Flow for web APIs to call downstream APIs while preserving user identity in MSAL.NET
| name | msal-client-credentials |
| description | Client Credentials Flow for service-to-service (daemon) authentication in MSAL.NET without user involvement |
| tags | ["msal","client-credentials","daemon","service-to-service","confidential-client","background-service","machine-to-machine"] |
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: