Skip to content

Commit

Permalink
docs updated
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukawska committed Jul 22, 2020
1 parent 1104446 commit 6e53f98
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions docs/features/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,61 @@ If a Route is authenticated Ocelot will invoke whatever scheme is associated wit

If you want to configure AuthenticationOptions the same for all Routes, do it in GlobalConfiguration the same way as for Route. If there are AuthenticationOptions configured both for GlobalConfiguration and Route (AuthenticationProviderKey is set), the Route section has priority. If you want to exclude route from global AuthenticationOptions, you can do that by setting AllowAnonymousForGlobalAuthenticationOptions to true in the route AuthenticationOptions - then this route will not be authenticated.

In the following example the first route will be authenticated with TestKeyGlobal provider key, the second one - with TestKey provider key, the others will not be authenticated.

.. code-block:: json
"Routes": [
{
"DownstreamPathTemplate": "/abc",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 54001
}],
"UpstreamPathTemplate": "/abc",
"UpstreamHttpMethod": [ "Get" ]
},
{
"DownstreamPathTemplate": "/def",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 54001
}],
"UpstreamPathTemplate": "/def",
"UpstreamHttpMethod": [ "Get" ],
"AuthenticationOptions": {
"AuthenticationProviderKey": "TestKey",
"AllowedScopes": []
}
},
{
"DownstreamPathTemplate": "/{action}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 54001
}],
"UpstreamPathTemplate": "/{action}",
"UpstreamHttpMethod": [ "Get" ],
"AuthenticationOptions": {
"AllowAnonymousForGlobalAuthenticationOptions": true
}
}
],
"GlobalConfiguration": {
"BaseUrl": "http://fake.test.com",
"AuthenticationOptions": {
"AuthenticationProviderKey": "TestKeyGlobal",
"AllowedScopes": []
}
}
JWT Tokens
^^^^^^^^^^

Expand Down

0 comments on commit 6e53f98

Please sign in to comment.