[Bug] Cannot get Access token from AcquireTokenInteractive
See original GitHub issueWhich Version of MSAL are you using ? Microsoft.Identity.Client: 4.18.0
Platform .Net 4.7.2
What authentication flow has the issue?
- Desktop / Mobile
- Interactive
- Integrated Windows Auth
- Username Password
- Device code flow (browserless)
- Web App
- Authorization code
- OBO
- Web API
- OBO
Other? - please describe;
Is this a new or existing app? This is a testing app before applying to my existing app
var pcaOptions = new PublicClientApplicationOptions
{
ClientId = "my client id",
TenantId = "my tenant id",
RedirectUri = "http://localhost:49468/",
};
string[] scopes = new string[] { "SMTP.Send" };
var app = PublicClientApplicationBuilder.CreateWithApplicationOptions(pcaOptions)
.WithLogging(Log, LogLevel.Verbose, true)
.Build();
var accounts = await app.GetAccountsAsync();
AuthenticationResult result;
try
{
result = await app.AcquireTokenSilent(scopes, accounts.FirstOrDefault())
.ExecuteAsync();
}
catch (MsalUiRequiredException)
{
try
{
result = await app.AcquireTokenInteractive(scopes)
.ExecuteAsync();
}
catch (Exception ex)
{
}
}
Expected behavior Getting the result with access token
Actual behavior Exception: A configuration issue is preventing authentication - check the error message from the server for details.You can modify the configuration in the application registration portal. See https://aka.ms/msal-net-invalid-client for details. Original exception: AADSTS7000218: The request body must contain the following parameter: ‘client_assertion’ or ‘client_secret’.
Possible Solution I did some research, people said that I need to set the application as a public client. But no luck
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (2 by maintainers)
Top GitHub Comments
Sorry for the late response, I have sent you the email with the manifest file. Please have a look. Regarding to my code, I provided above and pretty much it. It’s a console app to test acquiring access token interactively
Thanks for the update, @ntvuong1709it Closing this issue.