Merge pull request #1110 from ssilvert/KEYCLOAK-1166-admin-access-example-broken

KEYCLOAK-1166 Admin Access Example Broken
This commit is contained in:
Stian Thorgersen 2015-04-01 06:33:00 +02:00
commit abf8aea3f6
2 changed files with 2 additions and 0 deletions

View file

@ -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);

View file

@ -80,6 +80,7 @@ public class AdminClient {
List <NameValuePair> formparams = new ArrayList <NameValuePair>();
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);