keycloak-scim/testsuite/integration-arquillian/test-apps/servlet-authz
Pedro Igor 91bdc4bde2 [KEYCLOAK-3169] - UMA 2.0 (#4368)
* [KEYCLOAK-3169] - UMA 2.0 Support

* [KEYCLOAK-3169] - Changes to account service and more tests

* [KEYCLOAK-3169] - Code cleanup and tests

* [KEYCLOAK-3169] - Changes to account service and tests

* [KEYCLOAK-3169] - Changes to account service and tests

* [KEYCLOAK-3169] - More tests

* [KEYCLOAK-3169] - Changes to adapter configuration

* [KEYCLOAK-3169] - Reviewing UMA specs and more tests

* [KEYCLOAK-3169] - Reviewing UMA specs and more tests

* [KEYCLOAK-3169] - Changes to UMA Grant Type and refactoring

* [KEYCLOAK-3169] - Refresh tokens for RPT responses and tests

* [KEYCLOAK-3169] - Changes to account my resources and policy enforcers

* [KEYCLOAK-3169] - Realm settings flag to enable/disable user-managed access in account mgmt console

* [KEYCLOAK-3169] - More changes to my resource pages in account mgmt console

* [KEYCLOAK-3169] - Need to enable user-managed on realm to run tests

* [KEYCLOAK-3169] - Removing more UMA 1.0 related code

* [KEYCLOAK-3169] - Only submit requests if ticket exists

* [KEYCLOAK-3169] - Returning UMA 401 response when not authenticated

* [KEYCLOAK-3169] - Removing unused code

* [KEYCLOAK-3169] - Removing unused code

* [KEYCLOAK-3169] - 403 response in case ticket is not created

* [KEYCLOAK-3169] - Fixing AbstractPhotozExampleAdapterTest#testClientRoleRepresentingUserConsent

* [KEYCLOAK-3169] - 403 status code only returned for non-bearer clients
2018-02-28 08:53:10 +01:00
..
src/main/webapp [KEYCLOAK-3169] - UMA 2.0 (#4368) 2018-02-28 08:53:10 +01:00
keycloak-permissive-authz-service.json [KEYCLOAK-3169] - UMA 2.0 (#4368) 2018-02-28 08:53:10 +01:00
pom.xml Bump version to 4.0.0.CR1-SNAPSHOT 2017-12-21 15:06:00 +01:00
README.md [KEYCLOAK-3372] - Adding tests for servlet authorization 2016-07-29 12:42:53 -03:00
servlet-authz-app-authz-service.json [KEYCLOAK-5726] - Support define enforcement mode for scopes on the adapter configuration 2017-10-24 10:39:54 -02:00
servlet-authz-realm.json [KEYCLOAK-3372] - Adding tests for servlet authorization 2016-07-29 12:42:53 -03:00

About the Example Application

This is a simple Servlet-based application that will introduce you to some of the main concepts around Keycloak Authorization Services.

For this application, users can be regular users, premium users or administrators, where:

  • Regular users have very limited access.
  • Premium users have access to the premium area
  • Administrators have access to the administration area

In Keycloak, all the paths being protected are resources on the server.

This application will also show you how to create a dynamic menu with the permissions granted to an user.

Create the Example Realm and a Resource Server

Considering that your Keycloak Server is up and running, log in to the Keycloak Administration Console.

Now, create a new realm based on the following configuration file:

examples/authz/servlet-authz/servlet-authz-realm.json

That will import a pre-configured realm with everything you need to run this example. For more details about how to import a realm into Keycloak, check the Keycloak's reference documentation.

After importing that file, you'll have a new realm called servlet-authz.

Now, let's import another configuration using the Administration Console in order to configure the client application servlet-authz-app as a resource server with all resources, scopes, permissions and policies.

Click on Clients on the left side menu. Click on the servlet-authz-app on the client listing page. This will open the Client Details page. Once there, click on the Authorization tab.

Click on the Select file button, which means you want to import a resource server configuration. Now select the file that is located at:

examples/authz/servlet-authz/servlet-authz-app-config.json

Now click Upload and the resource server will be updated accordingly.

Deploy and Run the Example Applications

To deploy the example application, follow these steps:

cd examples/authz/servlet-authz
mvn clean package wildfly:deploy

Now, try to access the client application using the following URL:

http://localhost:8080/servlet-authz-app

If everything is correct, you will be redirect to Keycloak login page. You can login to the application with the following credentials:

  • username: jdoe / password: jdoe
  • username: alice / password: alice
  • username: admin / password: admin