Read optional client secret configuration to ensure we can use Basic auth as well

This commit is contained in:
Jeroen Rosenberg 2014-05-16 13:49:28 +02:00
parent 740943290c
commit d3a2617d3c

View file

@ -329,6 +329,7 @@ var Keycloak = function (config) {
kc.authServerUrl = config['auth-server-url']; kc.authServerUrl = config['auth-server-url'];
kc.realm = config['realm']; kc.realm = config['realm'];
kc.clientId = config['resource']; kc.clientId = config['resource'];
kc.clientSecret = (config['credentials'] || {})['secret'];
promise.setSuccess(); promise.setSuccess();
} else { } else {
@ -360,6 +361,7 @@ var Keycloak = function (config) {
kc.authServerUrl = config.url; kc.authServerUrl = config.url;
kc.realm = config.realm; kc.realm = config.realm;
kc.clientId = config.clientId; kc.clientId = config.clientId;
kc.clientSecret = (config.credentials || {}).secret;
promise.setSuccess(); promise.setSuccess();
} }