tokens/access/codes now uses basic auth
This commit is contained in:
1 parent
00043423c2
commit
6794166b58
6 files changed
+83
-25
No files matched your search
@@ -35,6 +35,7 @@ import org.json.JSONObject;
|
||||
import org.junit.Assert;
|
||||
import org.keycloak.RSATokenVerifier;
|
||||
import org.keycloak.VerificationException;
|
||||
import org.keycloak.util.BasicAuthHelper;
|
||||
import org.keycloak.util.JsonSerialization;
|
||||
import org.keycloak.representations.SkeletonKeyScope;
|
||||
import org.keycloak.representations.SkeletonKeyToken;
|
||||
@@ -121,11 +122,12 @@ public class OAuthClient {
|
||||
if (redirectUri != null) {
|
||||
parameters.add(new BasicNameValuePair("redirect_uri", redirectUri));
|
||||
}
|
||||
if (clientId != null) {
|
||||
parameters.add(new BasicNameValuePair("client_id", clientId));
|
||||
if (clientId != null && password != null) {
|
||||
String authorization = BasicAuthHelper.createHeader(clientId, password);
|
||||
post.setHeader("Authorization", authorization);
|
||||
}
|
||||
if (password != null) {
|
||||
parameters.add(new BasicNameValuePair("secret", password));
|
||||
else if (clientId != null) {
|
||||
parameters.add(new BasicNameValuePair("client_id", clientId));
|
||||
}
|
||||
|
||||
UrlEncodedFormEntity formEntity = null;
|
||||
|
||||
Reference in new issue
Block a user