use secrets
This commit is contained in:
1 parent
f66060e1be
commit
0cdd5e857e
43 files changed
+435
-398
No files matched your search
@@ -125,7 +125,7 @@ public class OAuthClient {
|
||||
parameters.add(new BasicNameValuePair("client_id", clientId));
|
||||
}
|
||||
if (password != null) {
|
||||
parameters.add(new BasicNameValuePair("password", password));
|
||||
parameters.add(new BasicNameValuePair("secret", password));
|
||||
}
|
||||
|
||||
UrlEncodedFormEntity formEntity = null;
|
||||
|
||||
+4
-6
@@ -62,8 +62,6 @@ public class CompositeRoleTest {
|
||||
realm.setAccessCodeLifespan(1000);
|
||||
realm.setSslNotRequired(true);
|
||||
realm.setEnabled(true);
|
||||
realm.addRequiredResourceCredential(UserCredentialModel.PASSWORD);
|
||||
realm.addRequiredOAuthClientCredential(UserCredentialModel.PASSWORD);
|
||||
realm.addRequiredCredential(UserCredentialModel.PASSWORD);
|
||||
final RoleModel realmRole1 = realm.addRole("REALM_ROLE_1");
|
||||
final RoleModel realmRole2 = realm.addRole("REALM_ROLE_2");
|
||||
@@ -86,21 +84,21 @@ public class CompositeRoleTest {
|
||||
realmComposite1Application.addScope(realmComposite1);
|
||||
realmComposite1Application.setBaseUrl("http://localhost:8081/app");
|
||||
realmComposite1Application.setManagementUrl("http://localhost:8081/app/logout");
|
||||
realm.updateCredential(realmComposite1Application.getApplicationUser(), UserCredentialModel.password("password"));
|
||||
realm.updateCredential(realmComposite1Application.getApplicationUser(), UserCredentialModel.secret("password"));
|
||||
|
||||
final ApplicationModel realmRole1Application = new ApplicationManager(manager).createApplication(realm, "REALM_ROLE_1_APPLICATION");
|
||||
realmRole1Application.setEnabled(true);
|
||||
realmRole1Application.addScope(realmRole1);
|
||||
realmRole1Application.setBaseUrl("http://localhost:8081/app");
|
||||
realmRole1Application.setManagementUrl("http://localhost:8081/app/logout");
|
||||
realm.updateCredential(realmRole1Application.getApplicationUser(), UserCredentialModel.password("password"));
|
||||
realm.updateCredential(realmRole1Application.getApplicationUser(), UserCredentialModel.secret("password"));
|
||||
|
||||
|
||||
final ApplicationModel appRoleApplication = new ApplicationManager(manager).createApplication(realm, "APP_ROLE_APPLICATION");
|
||||
appRoleApplication.setEnabled(true);
|
||||
appRoleApplication.setBaseUrl("http://localhost:8081/app");
|
||||
appRoleApplication.setManagementUrl("http://localhost:8081/app/logout");
|
||||
realm.updateCredential(appRoleApplication.getApplicationUser(), UserCredentialModel.password("password"));
|
||||
realm.updateCredential(appRoleApplication.getApplicationUser(), UserCredentialModel.secret("password"));
|
||||
final RoleModel appRole1 = appRoleApplication.addRole("APP_ROLE_1");
|
||||
final RoleModel appRole2 = appRoleApplication.addRole("APP_ROLE_2");
|
||||
|
||||
@@ -121,7 +119,7 @@ public class CompositeRoleTest {
|
||||
appCompositeApplication.setEnabled(true);
|
||||
appCompositeApplication.setBaseUrl("http://localhost:8081/app");
|
||||
appCompositeApplication.setManagementUrl("http://localhost:8081/app/logout");
|
||||
realm.updateCredential(appCompositeApplication.getApplicationUser(), UserCredentialModel.password("password"));
|
||||
realm.updateCredential(appCompositeApplication.getApplicationUser(), UserCredentialModel.secret("password"));
|
||||
final RoleModel appCompositeRole = appCompositeApplication.addRole("APP_COMPOSITE_ROLE");
|
||||
appCompositeApplication.addScope(appRole2);
|
||||
appCompositeRole.addCompositeRole(realmRole1);
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
"registrationAllowed": true,
|
||||
"resetPasswordAllowed": true,
|
||||
"requiredCredentials": [ "password" ],
|
||||
"requiredApplicationCredentials": [ "password" ],
|
||||
"requiredOAuthClientCredentials": [ "password" ],
|
||||
"smtpServer": {
|
||||
"from": "auto@keycloak.org",
|
||||
"host": "localhost",
|
||||
@@ -68,7 +66,7 @@
|
||||
"name" : "third-party",
|
||||
"enabled": true,
|
||||
"credentials" : [
|
||||
{ "type" : "password",
|
||||
{ "type" : "secret",
|
||||
"value" : "password" }
|
||||
]
|
||||
}
|
||||
@@ -109,7 +107,7 @@
|
||||
"adminUrl": "http://localhost:8081/app/logout",
|
||||
"credentials": [
|
||||
{
|
||||
"type": "password",
|
||||
"type": "secret",
|
||||
"value": "password"
|
||||
}
|
||||
]
|
||||
@@ -121,7 +119,7 @@
|
||||
"adminUrl": "http://localhost:8081/app/logout",
|
||||
"credentials": [
|
||||
{
|
||||
"type": "password",
|
||||
"type": "secret",
|
||||
"value": "password"
|
||||
}
|
||||
]
|
||||
@@ -133,7 +131,7 @@
|
||||
"adminUrl": "http://localhost:8081/app/logout",
|
||||
"credentials": [
|
||||
{
|
||||
"type": "password",
|
||||
"type": "secret",
|
||||
"value": "password"
|
||||
}
|
||||
]
|
||||
@@ -145,7 +143,7 @@
|
||||
"adminUrl": "http://localhost:8081/app/logout",
|
||||
"credentials": [
|
||||
{
|
||||
"type": "password",
|
||||
"type": "secret",
|
||||
"value": "password"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
"privateKey": "MIICXAIBAAKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQABAoGAfmO8gVhyBxdqlxmIuglbz8bcjQbhXJLR2EoS8ngTXmN1bo2L90M0mUKSdc7qF10LgETBzqL8jYlQIbt+e6TH8fcEpKCjUlyq0Mf/vVbfZSNaVycY13nTzo27iPyWQHK5NLuJzn1xvxxrUeXI6A2WFpGEBLbHjwpx5WQG9A+2scECQQDvdn9NE75HPTVPxBqsEd2z10TKkl9CZxu10Qby3iQQmWLEJ9LNmy3acvKrE3gMiYNWb6xHPKiIqOR1as7L24aTAkEAtyvQOlCvr5kAjVqrEKXalj0Tzewjweuxc0pskvArTI2Oo070h65GpoIKLc9jf+UA69cRtquwP93aZKtW06U8dQJAF2Y44ks/mK5+eyDqik3koCI08qaC8HYq2wVl7G2QkJ6sbAaILtcvD92ToOvyGyeE0flvmDZxMYlvaZnaQ0lcSQJBAKZU6umJi3/xeEbkJqMfeLclD27XGEFoPeNrmdx0q10Azp4NfJAY+Z8KRyQCR2BEG+oNitBOZ+YXF9KCpH3cdmECQHEigJhYg+ykOvr1aiZUMFT72HU0jnmQe2FVekuG+LJUt2Tm7GtMjTFoGpf0JwrVuZN39fOYAlo+nTixgeW7X8Y=",
|
||||
"publicKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB",
|
||||
"requiredCredentials": [ "password" ],
|
||||
"requiredApplicationCredentials": [ "password" ],
|
||||
"requiredOAuthClientCredentials": [ "password" ],
|
||||
"defaultRoles": [ "user" ],
|
||||
"smtpServer": {
|
||||
"from": "auto@keycloak.org",
|
||||
@@ -35,7 +33,7 @@
|
||||
"name" : "third-party",
|
||||
"enabled": true,
|
||||
"credentials" : [
|
||||
{ "type" : "password",
|
||||
{ "type" : "secret",
|
||||
"value" : "password" }
|
||||
]
|
||||
}
|
||||
@@ -64,7 +62,7 @@
|
||||
"adminUrl": "http://localhost:8081/app/logout",
|
||||
"credentials": [
|
||||
{
|
||||
"type": "password",
|
||||
"type": "secret",
|
||||
"value": "password"
|
||||
}
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user