-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #1676 Update authorization.rst * #1646 Update bigpicture.rst * #1628 Update websockets.rst * #1614 Update README.md * #1552 Update configuration.rst * #1547 Update caching.rst * #1542 Update requestaggregation.rst * Revert "#1639 Update ClientRateLimitMiddleware.cs" This reverts commit 996719e. * #1537 Update routing.rst * #1520 Update authentication.rst * #1459 Update building.rst Fix inline code block * #1412 Update errorcodes.rst * #1407 Update headerstransformation.rst * #1406 Update headerstransformation.rst Remove extra '!' * #1320 Update README.md * Update README.md Mark classes. Split sentences. * #1284 Update claimstransformation.rst * #1232 Update servicediscovery.rst * #1224 Update loadbalancer.rst * #1189 Update caching.rst * Update gettingstarted.rst Mark up 'net7.0' as code block. Convert script block to PowerShell one. Change the link to NuGet. * #1386 Update loadbalancer.rst * Update loadbalancer.rst: Make code snippet shorter * #1686 Update middlewareinjection.rst Add section "ASP.NET Core Middlewares and Ocelot Pipeline Builder" * Update logging.rst Review RST markup * Update methodtransformation.rst Review RST markup * Update README.md Sync to "Big Picture" page in Introduction
- Loading branch information
Showing
20 changed files
with
124 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
Authorization | ||
============= | ||
|
||
Ocelot supports claims based authorization which is run post authentication. This means if you have a route you want to authorize you can add the following to you Route configuration. | ||
Ocelot supports claims based authorization which is run post authentication. This means if you have a route you want to authorize you can add the following to your Route configuration. | ||
|
||
.. code-block:: json | ||
"RouteClaimsRequirement": { | ||
"UserType": "registered" | ||
} | ||
In this example when the authorization middleware is called Ocelot will check to seeif the user has the claim type UserType and if the value of that claim is registered. If it isn't then the user will not be authorized and the response will be 403 forbidden. | ||
|
||
|
||
|
||
In this example when the authorization middleware is called Ocelot will check to see if the user has the claim type UserType and if the value of that claim is registered. If it isn't then the user will not be authorized and the response will be 403 forbidden. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
Http Error Status Codes | ||
HTTP Error Status Codes | ||
======================= | ||
|
||
Ocelot will return HTTP status error codes based on internal logic in certain siturations: | ||
- 401 if the authentication middleware runs and the user is not authenticated. | ||
- 403 if the authorization middleware runs and the user is unauthenticated, claim value not authroised, scope not authorized, user doesnt have required claim or cannot find claim. | ||
- 503 if the downstream request times out. | ||
- 499 if the request is cancelled by the client. | ||
- 404 if unable to find a downstream route. | ||
- 502 if unable to connect to downstream service. | ||
- 500 if unable to complete the HTTP request downstream and the exception is not OperationCanceledException or HttpRequestException. | ||
- 404 if Ocelot is unable to map an internal error code to a HTTP status code. | ||
Ocelot will return HTTP status error codes based on internal logic in certain situations: | ||
|
||
Client error responses | ||
---------------------- | ||
|
||
- **401** - if the authentication middleware runs and the user is not authenticated. | ||
- **403** - if the authorization middleware runs and the user is unauthenticated, claim value not authorized, scope not authorized, user doesn't have required claim, or cannot find claim. | ||
- **404** - if unable to find a downstream route, or Ocelot is unable to map an internal error code to a HTTP status code. | ||
- **499** - if the request is cancelled by the client. | ||
|
||
Server error responses | ||
---------------------- | ||
|
||
- **500** - if unable to complete the HTTP request to downstream service, and the exception is not ``OperationCanceledException`` or ``HttpRequestException``. | ||
- **502** - if unable to connect to downstream service. | ||
- **503** - if the downstream request times out. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.