Ocelot provides the Addadministration method to set the configuration route and authorization mode
Services. Addocelot (). Addadministration ("/admin", options ={options. Authority="http://localhost:30000"; Options. Apiname="Ocelotapiadmin"; Options. Supportedtokens=IdentityServer4.AccessTokenValidation.SupportedTokens.Both; Options. Apisecret="liyouming"; Options. Requirehttpsmetadata=false; });
The Addadministration provides 2 overloads
1, (Path,secret)
2, (path,identityserver4authenticationoptions)
Configure Ocelot separate authorized access scope and related clients to
So how to check, update it?
/admin/configuration directly via Gateway hosted on port 20000 address
Http://localhost:20000/admin/configuration
But before we do, we need to get the authorization code through the client assignment.
Access Ocelot configuration address after getting Accesstoken
Get all configuration files, post to/admin/configuration and modifiable
By accessing this interface in the MicroServices architecture, the Ocelot configuration of Gateway Gateways is managed with new modifications to facilitate maintenance and modification of the Ocelot routing configuration without the tedious need to modify the JSON file for each gateway
JSON configuration file Management update with IDENTITYSERVER4 configuration Ocelot