Coder Social home page Coder Social logo

paybackman / ocelot.configeditor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dbarkwell/ocelot.configeditor

0.0 1.0 0.0 1.72 MB

A configuration editor for Ocelot (https://github.com/TomPallister/Ocelot)

License: MIT License

Shell 2.39% JavaScript 2.35% C# 15.01% PowerShell 0.31% CSS 73.45% HTML 6.49%

ocelot.configeditor's Introduction

Ocelot.ConfigEditor

A configuration editor for Ocelot (https://github.com/TomPallister/Ocelot).

Build Status

How To

  1. Add the Ocelot.ConfigEditor nuget package to an Ocelot application
  2. Add the Ocelot.ConfigEditor service with: AddOcelotConfigEditor

Examples:

.ConfigureServices(s =>
{
    s.AddOcelot();
    s.AddOcelotConfigEditor();
})
public void ConfigureServices(IServiceCollection services)
{
    services.AddOcelot();
    services.AddOcelotConfigEditor();
}
  1. 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();
}
  1. Build the project
  2. The default route is cfgedt. This can be changed by passing in ConfigEditorOptions

Example:

app.UseOcelotConfigEditor(new ConfigEditorOptions { Path = "edit" }); 
  1. 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.
  2. 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
  2. Click Azure Active Directory
  3. Click App registrations (Preview)
  4. Click New registration
  5. Add Name and change Supported account types if required. Add Redirect URI

Enable Google Authentication

  1. Create a new project through Google APIs
  2. In the Library page page, find Google+ API
  3. Click create credentials
  4. Choose, Google+ API, Web server, and User data
  5. Click "What credentials do I need?"
  6. Create an OAuth 2.0 client ID
  7. Enter Authorized redirect URIs which is https://{url}:{port}/signin-google
  8. Click Create client ID and set up the OAuth 2.0 consent screen
  9. Click continue
  10. 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
  2. Open the newly created AAD in Azure web portal
  3. Navigate to the Applications tab
  4. Add a new Application to the AAD. Set the "Sign-on URL" to sample application's URL
  5. Navigate to the Application, and click the Configure tab
  6. Find and save the "Client Id"
  7. Add a new key in the "Keys" section. Save value of the key, which is the "Client Secret"
  8. 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
  2. In the sidebar choose "Credentials"
  3. Navigate to "OAuth consent screen" tab, fill in the project name and save
  4. Navigate to "Credentials" tab. Click "Create credentials". Choose "OAuth client ID"
  5. Select "Web application" as the application type. Fill in the "Authorized redirect URIs" with https://{url}:{port}/signin-oidc
  6. Save the "Client ID" and "Client Secret" shown in the dialog
  7. The "Authority URL" for Google Authentication is https://accounts.google.com/

ocelot.configeditor's People

Contributors

dbarkwell avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.