From 6e39c3d2f77f19d093ef91475faa6e26ec34b77f Mon Sep 17 00:00:00 2001 From: Stan Silvert Date: Tue, 31 Mar 2015 14:53:38 -0400 Subject: [PATCH 1/2] KEYCLOAK-1166 Admin Access Example Broken --- .../src/main/java/org/keycloak/example/AdminClient.java | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/demo-template/admin-access-app/src/main/java/org/keycloak/example/AdminClient.java b/examples/demo-template/admin-access-app/src/main/java/org/keycloak/example/AdminClient.java index 8f6c951b69..8b3d40c4e2 100755 --- a/examples/demo-template/admin-access-app/src/main/java/org/keycloak/example/AdminClient.java +++ b/examples/demo-template/admin-access-app/src/main/java/org/keycloak/example/AdminClient.java @@ -80,6 +80,7 @@ public class AdminClient { List formparams = new ArrayList (); formparams.add(new BasicNameValuePair("username", "admin")); formparams.add(new BasicNameValuePair("password", "password")); + formparams.add(new BasicNameValuePair(OAuth2Constants.GRANT_TYPE, "password")); formparams.add(new BasicNameValuePair(OAuth2Constants.CLIENT_ID, "admin-client")); UrlEncodedFormEntity form = new UrlEncodedFormEntity(formparams, "UTF-8"); post.setEntity(form); From 89f2f640425b26334329dbb922f8a43aee708494 Mon Sep 17 00:00:00 2001 From: Stan Silvert Date: Tue, 31 Mar 2015 14:59:58 -0400 Subject: [PATCH 2/2] Fix doc for this. --- docbook/reference/en/en-US/modules/direct-access.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/docbook/reference/en/en-US/modules/direct-access.xml b/docbook/reference/en/en-US/modules/direct-access.xml index c08735b6ee..39b0e5cce0 100755 --- a/docbook/reference/en/en-US/modules/direct-access.xml +++ b/docbook/reference/en/en-US/modules/direct-access.xml @@ -87,6 +87,7 @@ try { if (isPublic()) { // if client is public access type formparams.add(new BasicNameValuePair(OAuth2Constants.CLIENT_ID, "customer-portal")); + formparams.add(new BasicNameValuePair(OAuth2Constants.GRANT_TYPE, "password")); } else { String authorization = BasicAuthHelper.createHeader("customer-portal", "secret-secret-secret"); post.setHeader("Authorization", authorization);