Merge pull request #1110 from ssilvert/KEYCLOAK-1166-admin-access-example-broken
KEYCLOAK-1166 Admin Access Example Broken
This commit is contained in:
commit
abf8aea3f6
2 changed files with 2 additions and 0 deletions
|
@ -87,6 +87,7 @@ try {
|
||||||
|
|
||||||
if (isPublic()) { // if client is public access type
|
if (isPublic()) { // if client is public access type
|
||||||
formparams.add(new BasicNameValuePair(OAuth2Constants.CLIENT_ID, "customer-portal"));
|
formparams.add(new BasicNameValuePair(OAuth2Constants.CLIENT_ID, "customer-portal"));
|
||||||
|
formparams.add(new BasicNameValuePair(OAuth2Constants.GRANT_TYPE, "password"));
|
||||||
} else {
|
} else {
|
||||||
String authorization = BasicAuthHelper.createHeader("customer-portal", "secret-secret-secret");
|
String authorization = BasicAuthHelper.createHeader("customer-portal", "secret-secret-secret");
|
||||||
post.setHeader("Authorization", authorization);
|
post.setHeader("Authorization", authorization);
|
||||||
|
|
|
@ -80,6 +80,7 @@ public class AdminClient {
|
||||||
List <NameValuePair> formparams = new ArrayList <NameValuePair>();
|
List <NameValuePair> formparams = new ArrayList <NameValuePair>();
|
||||||
formparams.add(new BasicNameValuePair("username", "admin"));
|
formparams.add(new BasicNameValuePair("username", "admin"));
|
||||||
formparams.add(new BasicNameValuePair("password", "password"));
|
formparams.add(new BasicNameValuePair("password", "password"));
|
||||||
|
formparams.add(new BasicNameValuePair(OAuth2Constants.GRANT_TYPE, "password"));
|
||||||
formparams.add(new BasicNameValuePair(OAuth2Constants.CLIENT_ID, "admin-client"));
|
formparams.add(new BasicNameValuePair(OAuth2Constants.CLIENT_ID, "admin-client"));
|
||||||
UrlEncodedFormEntity form = new UrlEncodedFormEntity(formparams, "UTF-8");
|
UrlEncodedFormEntity form = new UrlEncodedFormEntity(formparams, "UTF-8");
|
||||||
post.setEntity(form);
|
post.setEntity(form);
|
||||||
|
|
Loading…
Reference in a new issue