GCN-O-427413a281d9
GCN-O-427413a281d9: Unable to start GoCloudNative.Bff. Invalid client_secret. Configure the client_secret in the appsettings.json or program.cs file and try again.
The GoCloudNative BFF is an authentication gateway. As a result, you must configure an identity provider (correctly) for it to start.
To bootstrap the BFF, load the identity provider configuration from the appsettings.json
:
//...
var builder = WebApplication.CreateBuilder(args);
var config = builder.Configuration.GetSection("Oidc");
builder.Services.AddSecurityBff(o =>
{
o.ConfigureOpenIdConnect(config);
//...
});
How to reproduce this error
To reproduce the error, the ClientSecret
needs to be missing:
"Oidc": {
"CliendId": "{yourClientId}",
"Authority": "https://{yourAuthority}",
"Scopes": [
"openid", "profile", "offline_access"
]
},
or empty:
"Oidc": {
"CliendId": "{yourClientId}",
"ClientSecret": "",
"Authority": "https://{yourAuthority}",
"Scopes": [
"openid", "profile", "offline_access"
]
},
or misspelled:
"Oidc": {
"CliendId": "{yourClientId}",
"Client_Secret": "{yourClientSecret}",
"Authority": "https://{yourAuthority}",
"Scopes": [
"openid", "profile", "offline_access"
]
},
or incorrect casing:
"Oidc": {
"CliendId": "{yourClientId}",
"Clientsecret": "{yourClientSecret}",
"Authority": "https://{yourAuthority}",
"Scopes": [
"openid", "profile", "offline_access"
]
},
Solution
Configure the ClientSecret
correctly:
"Oidc": {
"CliendId": "{yourClientId}",
"ClientSecret": "{yourClientSecret}",
"Authority": "https://{yourAuthority}",
"Scopes": [
"openid", "profile", "offline_access"
]
},
and restart the BFF.