Examples
Keycloak授权还可以帮助您快速开始使用授权服务,并了解如何将相同的概念应用于您自己的应用程序。
如果您使用的是Keycloak Demo Distribution,并且您在文件系统中正确解压缩:
- keycloak-demo-3.2.0.Final.[zip|tar.gz]
您可以从以下目录中查看可用的示例:
cd ${KEYCLOAK_DEMO_SERVER_DIR}/examples/authz
或者您可以从GitHub获取它们。
每个示例都有一个README文件,其中包含有关如何构建,部署和测试示例的说明。 以下是每个示例的简要说明
Name | Description |
---|---|
hello-world-authz-service | A single-page application that is protected by a policy enforcer that decides whether a user can access that page based on the permissions obtained from a Keycloak Server. |
photoz | A simple application based on HTML5+AngularJS+JAX-RS that demonstrates how to enable fine-grained permissions to RESTFul based services and HTML5 clients. |
servlet-authz | A simple Servlet-based application that demonstrates how to enable fine-grained authorization to a JBoss/Wildfly Servlet Application. |