keycloak-scim/authorization_services/topics/resource-server/default-config.adoc

46 lines
2.6 KiB
Text
Raw Normal View History

2016-11-29 15:30:53 +00:00
[[_resource_server_default_config]]
=== Default Configuration
2016-06-16 17:08:04 +00:00
When you create a resource server, {{book.project.name}} creates a default configuration for your newly created resource server.
2016-06-16 17:08:04 +00:00
The default configuration consists of:
* A default protected resource representing all resources in your application.
* A policy that always grants access to the resources protected by this policy.
2016-06-16 17:08:04 +00:00
* A permission that governs access to all resources based on the default policy.
The default protected resource is referred to as the *default resource* and you can view it if you navigate to the *Resources* tab.
2016-06-16 17:08:04 +00:00
.Default Resource
2017-01-05 16:54:31 +00:00
image:../../{{book.images}}/resource-server/default-resource.png[alt="Default Resource"]
2016-06-16 17:08:04 +00:00
This resource defines a `Type`, namely `urn:my-resource-server:resources:default` and a `URI` `/*`. Here, the `URI` field defines a
wildcard pattern that indicates to {{book.project.name}} that this resource represents all the paths in your application. In other words,
2016-11-29 15:30:53 +00:00
when enabling <<fake/../../enforcer/overview.adoc#_enforcer_overview, policy enforcement>> for your application, all the permissions associated with the resource
will be examined before granting access.
2016-06-16 17:08:04 +00:00
2016-11-29 15:30:53 +00:00
The `Type` mentioned previously defines a value that can be used to create <<fake/../../permission/typed-resource-permission.adoc#_permission_typed_resource, typed resource permissions>> that must be applied
2016-07-26 21:34:49 +00:00
to the default resource or any other resource you create using the same type.
The default policy is referred to as the *only from realm policy* and you can view it if you navigate to the *Policies* tab.
2016-06-16 17:08:04 +00:00
.Default Policy
2017-01-05 16:54:31 +00:00
image:../../{{book.images}}/resource-server/default-policy.png[alt="Default Policy"]
2016-06-16 17:08:04 +00:00
2016-11-29 15:30:53 +00:00
This policy is a <<fake/../../policy/js-policy.adoc#_policy_js, JavaScript-based policy>> defining a condition that always grants access to the resources protected by this policy. If you click this policy you can see that it defines a rule as follows:
2016-06-16 17:08:04 +00:00
```js
2016-07-26 21:34:49 +00:00
// by default, grants any permission associated with this policy
$evaluation.grant();
2016-06-16 17:08:04 +00:00
```
Lastly, the default permission is referred to as the *default permission* and you can view it if you navigate to the *Permissions* tab.
2016-06-16 17:08:04 +00:00
.Default Permission
2017-01-05 16:54:31 +00:00
image:../../{{book.images}}/resource-server/default-permission.png[alt="Default Permission"]
2016-06-16 17:08:04 +00:00
2016-11-29 15:30:53 +00:00
This permission is a <<fake/../../permission/create-resource.adoc#_permission_create_resource, resource-based permission>>, defining a set of one or more policies that are applied to all resources with a given type.
2016-06-16 17:08:04 +00:00
==== Changing the Default Configuration
2016-06-16 17:08:04 +00:00
You can change the default configuration by removing the default resource, policy, or permission definitions and creating your own.