18.14. 인증 작업
암호 정책 설정
-
영역의
passwordPolicy특성을 특정 정책 공급자 ID 및 선택적 구성을 포함하는 CloudEvent 표현식으로 설정합니다. 다음 예제를 사용하여 암호 정책을 기본값으로 설정합니다. 기본값은 다음과 같습니다.
- 27,500 해시 반복
- 하나 이상의 특수 문자
- 하나 이상의 대문자
- 하나 이상의 숫자 문자
-
사용자
이름과같지 않음 최소 8자 이상이어야 합니다.
kcadm.sh update realms/demorealm -s 'passwordPolicy="hashIterations and specialChars and upperCase and digits and notUsername and length"'
$ kcadm.sh update realms/demorealm -s 'passwordPolicy="hashIterations and specialChars and upperCase and digits and notUsername and length"'Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- 기본값과 다른 값을 사용하려면 대괄호로 구성을 전달합니다.
다음 예제를 사용하여 암호 정책을 다음과 같이 설정합니다.
- 25,000 해시 반복
- 두 개 이상의 특수 문자
- 두 개 이상의 대문자
- 두 개 이상의 소문자
- 최소 두 자리 숫자
- 최소 9자 이상이어야 합니다.
-
사용자
이름과같지 않음 4개 이상의 변경 사항을 반복할 수 없습니다.
kcadm.sh update realms/demorealm -s 'passwordPolicy="hashIterations(25000) and specialChars(2) and upperCase(2) and lowerCase(2) and digits(2) and length(9) and notUsername and passwordHistory(4)"'
$ kcadm.sh update realms/demorealm -s 'passwordPolicy="hashIterations(25000) and specialChars(2) and upperCase(2) and lowerCase(2) and digits(2) and length(9) and notUsername and passwordHistory(4)"'Copy to Clipboard Copied! Toggle word wrap Toggle overflow
현재 암호 정책 가져오기
passwordPolicy 특성을 제외한 모든 출력을 필터링하여 현재 영역 구성을 가져올 수 있습니다.
예를 들어 demorealm 에 대한 passwordPolicy 를 표시합니다.
kcadm.sh get realms/demorealm --fields passwordPolicy
$ kcadm.sh get realms/demorealm --fields passwordPolicy
인증 흐름 나열
authentication/flows 끝점에서 get 명령을 실행합니다.
예를 들면 다음과 같습니다.
kcadm.sh get authentication/flows -r demorealm
$ kcadm.sh get authentication/flows -r demorealm
특정 인증 흐름 가져오기
authentication/flows/FLOW_ID 끝점에서 get 명령을 실행합니다.
예를 들면 다음과 같습니다.
kcadm.sh get authentication/flows/febfd772-e1a1-42fb-b8ae-00c0566fafb8 -r demorealm
$ kcadm.sh get authentication/flows/febfd772-e1a1-42fb-b8ae-00c0566fafb8 -r demorealm
흐름 실행 나열
authentication/flows/FLOW_ALIAS/executions 끝점에서 get 명령을 실행합니다.
예를 들면 다음과 같습니다.
kcadm.sh get authentication/flows/Copy%20of%20browser/executions -r demorealm
$ kcadm.sh get authentication/flows/Copy%20of%20browser/executions -r demorealm
실행에 구성 추가
- 흐름에 대한 실행을 가져옵니다.
- 흐름의 ID를 기록해 둡니다.
-
authentication/executions/{executionId}/config끝점에서create명령을 실행합니다.
예를 들면 다음과 같습니다.
kcadm create "authentication/executions/a3147129-c402-4760-86d9-3f2345e401c7/config" -r examplerealm -b '{"config":{"x509-cert-auth.mapping-source-selection":"Match SubjectDN using regular expression","x509-cert-auth.regular-expression":"(.*?)(?:$)","x509-cert-auth.mapper-selection":"Custom Attribute Mapper","x509-cert-auth.mapper-selection.user-attribute-name":"usercertificate","x509-cert-auth.crl-checking-enabled":"","x509-cert-auth.crldp-checking-enabled":false,"x509-cert-auth.crl-relative-path":"crl.pem","x509-cert-auth.ocsp-checking-enabled":"","x509-cert-auth.ocsp-responder-uri":"","x509-cert-auth.keyusage":"","x509-cert-auth.extendedkeyusage":"","x509-cert-auth.confirmation-page-disallowed":""},"alias":"my_otp_config"}'
$ kcadm create "authentication/executions/a3147129-c402-4760-86d9-3f2345e401c7/config" -r examplerealm -b '{"config":{"x509-cert-auth.mapping-source-selection":"Match SubjectDN using regular expression","x509-cert-auth.regular-expression":"(.*?)(?:$)","x509-cert-auth.mapper-selection":"Custom Attribute Mapper","x509-cert-auth.mapper-selection.user-attribute-name":"usercertificate","x509-cert-auth.crl-checking-enabled":"","x509-cert-auth.crldp-checking-enabled":false,"x509-cert-auth.crl-relative-path":"crl.pem","x509-cert-auth.ocsp-checking-enabled":"","x509-cert-auth.ocsp-responder-uri":"","x509-cert-auth.keyusage":"","x509-cert-auth.extendedkeyusage":"","x509-cert-auth.confirmation-page-disallowed":""},"alias":"my_otp_config"}'
실행을 위한 구성 가져오기
- 흐름에 대한 실행을 가져옵니다.
-
구성 ID가 포함된
authenticationConfig속성을 기록해 둡니다. -
authentication/config/ID엔드포인트에서get명령을 실행합니다.
예를 들면 다음과 같습니다.
kcadm get "authentication/config/dd91611a-d25c-421a-87e2-227c18421833" -r examplerealm
$ kcadm get "authentication/config/dd91611a-d25c-421a-87e2-227c18421833" -r examplerealm
실행 구성 업데이트
- 흐름에 대한 실행을 가져옵니다.
-
흐름의
authenticationConfig특성을 가져옵니다. - 속성의 구성 ID를 기록해 둡니다.
-
authentication/config/ID엔드포인트에서update명령을 실행합니다.
예를 들면 다음과 같습니다.
kcadm update "authentication/config/dd91611a-d25c-421a-87e2-227c18421833" -r examplerealm -b '{"id":"dd91611a-d25c-421a-87e2-227c18421833","alias":"my_otp_config","config":{"x509-cert-auth.extendedkeyusage":"","x509-cert-auth.mapper-selection.user-attribute-name":"usercertificate","x509-cert-auth.ocsp-responder-uri":"","x509-cert-auth.regular-expression":"(.*?)(?:$)","x509-cert-auth.crl-checking-enabled":"true","x509-cert-auth.confirmation-page-disallowed":"","x509-cert-auth.keyusage":"","x509-cert-auth.mapper-selection":"Custom Attribute Mapper","x509-cert-auth.crl-relative-path":"crl.pem","x509-cert-auth.crldp-checking-enabled":"false","x509-cert-auth.mapping-source-selection":"Match SubjectDN using regular expression","x509-cert-auth.ocsp-checking-enabled":""}}'
$ kcadm update "authentication/config/dd91611a-d25c-421a-87e2-227c18421833" -r examplerealm -b '{"id":"dd91611a-d25c-421a-87e2-227c18421833","alias":"my_otp_config","config":{"x509-cert-auth.extendedkeyusage":"","x509-cert-auth.mapper-selection.user-attribute-name":"usercertificate","x509-cert-auth.ocsp-responder-uri":"","x509-cert-auth.regular-expression":"(.*?)(?:$)","x509-cert-auth.crl-checking-enabled":"true","x509-cert-auth.confirmation-page-disallowed":"","x509-cert-auth.keyusage":"","x509-cert-auth.mapper-selection":"Custom Attribute Mapper","x509-cert-auth.crl-relative-path":"crl.pem","x509-cert-auth.crldp-checking-enabled":"false","x509-cert-auth.mapping-source-selection":"Match SubjectDN using regular expression","x509-cert-auth.ocsp-checking-enabled":""}}'
실행을 위한 구성 삭제
- 흐름에 대한 실행을 가져옵니다.
-
flows
authenticationConfig특성을 가져옵니다. - 속성의 구성 ID를 기록해 둡니다.
-
authentication/config/ID엔드포인트에서delete명령을 실행합니다.
예를 들면 다음과 같습니다.
kcadm delete "authentication/config/dd91611a-d25c-421a-87e2-227c18421833" -r examplerealm
$ kcadm delete "authentication/config/dd91611a-d25c-421a-87e2-227c18421833" -r examplerealm