Closed
Description
Which version of Microsoft Identity Web are you using?
0.4.0-preview
Where is the issue?
- Web app
- Sign-in users
- [ x] Sign-in users and call web APIs
- Web API
- Protected web APIs (validating tokens)
- Protected web APIs (validating scopes)
- [ ]x Protected web APIs call downstream web APIs
- Token cache serialization
- In-memory caches
- Session caches
- Distributed caches
- Other (please describe)
Expected behavior
- Ideally: Passing the client secret in either MicrosoftIdentityOptions or ConfidentialClientApplicationOptions shoud work
- If not possible : Passing the client secret in ConfidentialClientApplicationOptions should set it in MicrosoftIdentityOptions
Actual behavior
The developer has to set it in both places:
public void ConfigureServices(IServiceCollection services)
{
_keyVault = new KeyVaultSecretsProvider();
string ccaSecret = _keyVault.GetSecret(TestConstants.OBOClientKeyVaultUri).Value;
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApi(Configuration, subscribeToJwtBearerMiddlewareDiagnosticsEvents: true)
.EnableTokenAcquisitionToCallDownstreamApi()
.AddInMemoryTokenCaches();
services.Configure<MicrosoftIdentityOptions>(options =>
{
options.ClientSecret = ccaSecret;
});
services.Configure<ConfidentialClientApplicationOptions>(options =>
{
options.ClientSecret = ccaSecret;
});