I have .NET Core app with IdentityServer 4 in it.
I want to hide/remove one entry of "scopes_supported" under .well-known/openid-configuration endpoint.
Basically it shows all my custom scopes, but one is automatically generated, maybe anyone can help me hiding it?
....
"scopes_supported": [
"openid",
"profile",
"custom_scope1",
"custom_scope2",
"offline_access" // <----- this one worries me, how to remove it
],
....
The code for the discovery document creation that adds the offline_Access scope is found here.
If you disable the Options.Discovery.ShowApiScopes flag, then it will not be shown, but you won't see the ApiScopes either it seems.
See this page for how to disable that flag or you disable it as shown below.
services.AddIdentityServer(options =>
{
options.Discovery.ShowIdentityScopes = false;
options.Discovery.ShowApiScopes = false;
options.Discovery.ShowClaims = false;
options.Discovery.ShowExtensionGrantTypes = false;
});
It seems you can't just hide the offline_scope.