You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at the logs generated by MS.Id.Web in Application Insights, it seems that the value of the Client Secret is logged in plaintext when building a confidential client using a client secret.
Log Message (note starting characters):
App Registration secrets:
This can be confirmed as a real secret as we were able to copy the secret value from the ClientSecret__XXX log message & use it to request a token.
From what I can gather, this logging was introduced as part of this commit.
Reproduction steps
Configure an app with AzureAd:ClientSecret set
Use IAuthorizationHeaderProvider.CreateAuthorizationHeaderForUserAsync() when calling a protected downstream API
Observe logging output when token is requested
Error message
No response
Id Web logs
No response
Relevant code snippets
internalclassApiService(IAuthorizationHeaderProviderprovider){privateasyncTask<string>GetAuthHeaderForUserAsync(CancellationTokencancellationToken){try{varapiScopes="...";varauthHeader=awaitprovider.CreateAuthorizationHeaderForUserAsync(apiScopes,cancellationToken:cancellationToken);returnauthHeader;}catch(Exceptionex){logger.LogError(ex,"An error occurred while acquiring a token for a user from Entra ID");throw;}}}
Regression
3.1.0
Expected behavior
Client Secret should not be included in the log message
The text was updated successfully, but these errors were encountered:
Microsoft.Identity.Web Library
Microsoft.Identity.Web
Microsoft.Identity.Web version
3.5.0
Web app
Not Applicable
Web API
Protected web APIs call downstream web APIs
Token cache serialization
Not Applicable
Description
Hi
Looking at the logs generated by MS.Id.Web in Application Insights, it seems that the value of the Client Secret is logged in plaintext when building a confidential client using a client secret.
Log Message (note starting characters):
App Registration secrets:
This can be confirmed as a real secret as we were able to copy the secret value from the
ClientSecret__XXX
log message & use it to request a token.From what I can gather, this logging was introduced as part of this commit.
Reproduction steps
AzureAd:ClientSecret
setIAuthorizationHeaderProvider.CreateAuthorizationHeaderForUserAsync()
when calling a protected downstream APIError message
No response
Id Web logs
No response
Relevant code snippets
Regression
3.1.0
Expected behavior
Client Secret should not be included in the log message
The text was updated successfully, but these errors were encountered: