Вопрос

I am using 'WebSphere 7 Application Server' in a clustered environment. I am attempting to use jython to script the configuration and setup. All well thus far. However, I have hit a road block. I cannot find a way to modify the 'Custom properties' for 'Global security'. To be more precise, I want to add the following custom property using jython:

com.ibm.ws.security.addHttpOnlyAttributeToCookies

I know how to do this using the 'Integrated Solutions Console', but not with scripting. Does anyone have any ideas on how to do this?

Это было полезно?

Решение

sec = AdminConfig.getid('/Security:/')
prop = AdminConfig.getid('/Cell:/Security:/Property:com.ibm.ws.security.addHttpOnlyAttributeToCookies/')
if prop:
    AdminConfig.modify(prop, [['value', 'true']])
else:
    AdminConfig.create('Property', sec, [['name','com.ibm.ws.security.addHttpOnlyAttributeToCookies'], ['value','true']])
AdminConfig.save()
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top