Keycloak

Форк
0
/
adapter-elytron-install-saml.cli 
59 строк · 3.9 Кб
1
if (outcome != success) of /extension=org.keycloak.keycloak-saml-adapter-subsystem:read-resource
2
    /extension=org.keycloak.keycloak-saml-adapter-subsystem/:add(module=org.keycloak.keycloak-saml-adapter-subsystem)
3
else
4
    echo Keycloak SAML Extension already installed
5
end-if
6

7
if (outcome != success) of /subsystem=keycloak-saml:read-resource
8
    /subsystem=keycloak-saml:add
9
else
10
    echo Keycloak SAML Subsystem already installed
11
end-if
12

13
if (outcome != success) of /subsystem=elytron/custom-realm=KeycloakSAMLRealm:read-resource
14
    /subsystem=elytron/custom-realm=KeycloakSAMLRealm:add(class-name=org.keycloak.adapters.saml.elytron.KeycloakSecurityRealm, module=org.keycloak.keycloak-saml-wildfly-elytron-adapter)
15
else
16
    echo Keycloak SAML Realm already installed
17
end-if
18

19
if (outcome != success) of /subsystem=elytron/security-domain=KeycloakDomain:read-resource
20
    /subsystem=elytron/security-domain=KeycloakDomain:add(default-realm=KeycloakSAMLRealm,permission-mapper=default-permission-mapper,security-event-listener=local-audit,realms=[{realm=KeycloakSAMLRealm}])
21
else
22
    echo Keycloak Security Domain already installed. Trying to install Keycloak SAML Realm.
23
    /subsystem=elytron/security-domain=KeycloakDomain:list-add(name=realms, value={realm=KeycloakSAMLRealm})
24
end-if
25

26
if (outcome != success) of /subsystem=elytron/constant-realm-mapper=keycloak-saml-realm-mapper:read-resource
27
    /subsystem=elytron/constant-realm-mapper=keycloak-saml-realm-mapper:add(realm-name=KeycloakSAMLRealm)
28
else
29
    echo Keycloak SAML Realm Mapper already installed
30
end-if
31

32
if (outcome != success) of /subsystem=elytron/service-loader-http-server-mechanism-factory=keycloak-saml-http-server-mechanism-factory:read-resource
33
    /subsystem=elytron/service-loader-http-server-mechanism-factory=keycloak-saml-http-server-mechanism-factory:add(module=org.keycloak.keycloak-saml-wildfly-elytron-adapter)
34
else
35
    echo Keycloak SAML HTTP Mechanism Factory already installed
36
end-if
37

38
if (outcome != success) of /subsystem=elytron/aggregate-http-server-mechanism-factory=keycloak-http-server-mechanism-factory:read-resource
39
    /subsystem=elytron/aggregate-http-server-mechanism-factory=keycloak-http-server-mechanism-factory:add(http-server-mechanism-factories=[keycloak-saml-http-server-mechanism-factory, global])
40
else
41
    echo Keycloak HTTP Mechanism Factory already installed. Trying to install Keycloak SAML HTTP Mechanism Factory.
42
    /subsystem=elytron/aggregate-http-server-mechanism-factory=keycloak-http-server-mechanism-factory:list-add(name=http-server-mechanism-factories, value=keycloak-saml-http-server-mechanism-factory)
43
end-if
44

45
if (outcome != success) of /subsystem=elytron/http-authentication-factory=keycloak-http-authentication:read-resource
46
    /subsystem=elytron/http-authentication-factory=keycloak-http-authentication:add(security-domain=KeycloakDomain,http-server-mechanism-factory=keycloak-http-server-mechanism-factory,mechanism-configurations=[{mechanism-name=KEYCLOAK-SAML,mechanism-realm-configurations=[{realm-name=KeycloakSAMLCRealm,realm-mapper=keycloak-saml-realm-mapper}]}])
47
else
48
    echo Keycloak HTTP Authentication Factory already installed. Trying to install Keycloak SAML Mechanism Configuration
49
    /subsystem=elytron/http-authentication-factory=keycloak-http-authentication:list-add(name=mechanism-configurations, value={mechanism-name=KEYCLOAK-SAML,mechanism-realm-configurations=[{realm-name=KeycloakSAMLRealm,realm-mapper=keycloak-saml-realm-mapper}]})
50
end-if
51

52
if (outcome != success) of /subsystem=undertow/application-security-domain=other:read-resource
53
    /subsystem=undertow/application-security-domain=other:add(http-authentication-factory=keycloak-http-authentication)
54
else
55
    batch
56
    /subsystem=undertow/application-security-domain=other:undefine-attribute(name=security-domain)
57
    /subsystem=undertow/application-security-domain=other:write-attribute(name=http-authentication-factory,value=keycloak-http-authentication)
58
    run-batch
59
end-if
60

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.