-
Notifications
You must be signed in to change notification settings - Fork 66
Deploying REST extensions fails with "basic" security #208
Comments
I have similar problems when running tests via the command line with basic authentication. Switching to digest fixed the problem. Roxy version 1.6 (dev-branch)
|
The problem still seems to reproduce using version 1.7.1.
|
Make sure you have this in your properties:
Next to this, internal security needs to be true for some reason. It is almost as if you either need to use ldap or internal auth, but can't use both despite what the docs tell us.. |
I have specified the authentication-method as basic, but unfortunately, I'm using internal-security = false, and have an ldap connected. Thank you! |
No, I meant that according to the docs you should be able to use internal-security=true, and still be able to do both internal auth + external auth if the user was not found internally. But this doesn't work. That is a problem in ML itself. Roxy uses ml.user/ml.password for bootstrap, deploy, etc. That needs to be an ML internal user. But if you try to deploy REST options/extensions against an app server that uses external ldap security, that same ml.user user probably doesn't exist in your LDAP directory, and doing PUT/POST to install extensions won't work. You can either switch back and forth the internal security while doing deploy rest, or you need to enter an LDAP user as ml.user, and recreate that user in ML so that bootstrap works with it too. |
Regarding switching back and forth of internal security, I am using this in app_specific.rb: # adjust REST security to allow deploy
alias_method :original_deploy_rest, :deploy_rest
def deploy_rest()
r = execute_query %Q{
xquery version "1.0-ml";
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy";
let $config := admin:get-configuration()
let $config := admin:appserver-set-internal-security($config, xdmp:server("#{@properties["ml.app-name"]}"), fn:true())
return
admin:save-configuration-without-restart($config)
},
{ :app_name => @properties["ml.app-name"] }
original_deploy_rest
r = execute_query %Q{
xquery version "1.0-ml";
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy";
let $config := admin:get-configuration()
let $config := admin:appserver-set-internal-security($config, xdmp:server("#{@properties["ml.app-name"]}"), fn:false())
return
admin:save-configuration-without-restart($config)
},
{ :app_name => @properties["ml.app-name"] }
end |
@grtjn, thanks for your reply. The proposed solution is working fine |
When the target HTTP app server's authentication is set to "basic", the deploy modules command will fail when trying to deploy REST extensions. Contents of the source directory are deployed successfully.
The error message:
The text was updated successfully, but these errors were encountered: