Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dbarkwell/Ocelot.ConfigEditor
A configuration editor for Ocelot (https://github.com/TomPallister/Ocelot)
https://github.com/dbarkwell/Ocelot.ConfigEditor
Last synced: about 2 months ago
JSON representation
A configuration editor for Ocelot (https://github.com/TomPallister/Ocelot)
- Host: GitHub
- URL: https://github.com/dbarkwell/Ocelot.ConfigEditor
- Owner: dbarkwell
- License: mit
- Created: 2017-10-24T12:05:16.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T09:20:12.000Z (about 2 years ago)
- Last Synced: 2024-08-02T06:17:35.310Z (5 months ago)
- Language: CSS
- Size: 1.77 MB
- Stars: 138
- Watchers: 13
- Forks: 37
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ocelot - A configuration editor for Ocelot
README
# Ocelot.ConfigEditor
A configuration editor for Ocelot (https://github.com/TomPallister/Ocelot).[![Build Status](https://dev.azure.com/pelism/Ocelot.ConfigEditor/_apis/build/status/dbarkwell.Ocelot.ConfigEditor?branchName=master)](https://dev.azure.com/pelism/Ocelot.ConfigEditor/_build/latest?definitionId=13&branchName=master)
## How To
1. Add the Ocelot.ConfigEditor nuget package to an Ocelot application
1. Add the Ocelot.ConfigEditor service with: AddOcelotConfigEditorExamples:
```
.ConfigureServices(s =>
{
s.AddOcelot();
s.AddOcelotConfigEditor();
})
```
```
public void ConfigureServices(IServiceCollection services)
{
services.AddOcelot();
services.AddOcelotConfigEditor();
}
```3. Add the Ocelot.ConfigEditor middleware with: UseOcelotConfigEditor
Examples:
```
.Configure(app =>
{
app.UseOcelotConfigEditor();
app.UseOcelot().Wait();
}
```
```
public void Configure(IApplicationBuilder app)
{
app.UseOcelotConfigEditor();
app.UseOcelot().Wait();
}
```4. Build the project
5. The default route is cfgedt. This can be changed by passing in ConfigEditorOptionsExample:
```
app.UseOcelotConfigEditor(new ConfigEditorOptions { Path = "edit" });
```6. The default authorization is localhost. See below for different authorization types.
## Authorization
There are two ways to authorize access to the config editor. The authorization types are:1. Localhost (default). The configuration page is only accessible from localhost.
1. Authenticating against a third party identity service. Currently, AzureAD, Google, and Open Id Connect are configured.
### Enable Azure AD Authentication
1. Sign into Azure Portal
1. Click Azure Active Directory
1. Click App registrations (Preview)
1. Click New registration
1. Add Name and change Supported account types if required. Add Redirect URI### Enable Google Authentication
1. Create a new project through Google APIs
1. In the Library page page, find Google+ API
1. Click create credentials
1. Choose, Google+ API, Web server, and User data
1. Click "What credentials do I need?"
1. Create an OAuth 2.0 client ID
1. Enter Authorized redirect URIs which is https://{url}:{port}/signin-google
1. Click Create client ID and set up the OAuth 2.0 consent screen
1. Click continue
1. Click Download on Download credentials to download Client and Secret Id### Enable Open Id Connect Authentication
#### Configure with Azure Active Directory
1. Set up a new Azure Active Directory (AAD) in your Azure Subscription
1. Open the newly created AAD in Azure web portal
1. Navigate to the Applications tab
1. Add a new Application to the AAD. Set the "Sign-on URL" to sample application's URL
1. Navigate to the Application, and click the Configure tab
1. Find and save the "Client Id"
1. Add a new key in the "Keys" section. Save value of the key, which is the "Client Secret"
1. Click the "View Endpoints" on the drawer, a dialog will shows six endpoint URLs. Copy the "OAuth 2.0 Authorization Endpoint" to a text editor and remove the "/oauth2/authorize" from the string. The remaining part is the authority URL. It looks like https://login.microsoftonline.com/#### Configure with Google Identity Platform
1. Create a new project through Google APIs
1. In the sidebar choose "Credentials"
1. Navigate to "OAuth consent screen" tab, fill in the project name and save
1. Navigate to "Credentials" tab. Click "Create credentials". Choose "OAuth client ID"
1. Select "Web application" as the application type. Fill in the "Authorized redirect URIs" with https://{url}:{port}/signin-oidc
1. Save the "Client ID" and "Client Secret" shown in the dialog
1. The "Authority URL" for Google Authentication is https://accounts.google.com/