検索

17.14. 認証操作

download PDF

パスワードポリシーの設定

  1. レルムの passwordPolicy 属性を、特定のポリシープロバイダー ID と任意の設定が含まれる列挙式に設定します。
  2. 以下の例を使用して、パスワードポリシーをデフォルト値に設定します。デフォルト値には以下が含まれます。

    • 210,000 回のハッシュの反復
    • 少なくとも 1 つの特殊文字
    • 少なくとも 1 つの大文字の文字
    • 最低でも 1 桁の文字
    • ユーザーの username と等しくない
    • 8 文字以上であること

      $ kcadm.sh update realms/demorealm -s 'passwordPolicy="hashIterations and specialChars and upperCase and digits and notUsername and length"'
  3. デフォルト値と異なる値を使用する場合は、括弧で設定を渡します。
  4. 以下の例を使用して、パスワードポリシーを以下のように設定します。

    • 300,000 回のハッシュの反復
    • 少なくとも 2 つの特殊文字
    • 少なくとも 2 つの大文字
    • 少なくとも 2 つの小文字
    • 少なくとも 2 桁
    • 最低 9 文字の長さであること
    • ユーザーの username と等しくない
    • 少なくとも 4 つの変更の場合、繰り返すことはありません。

      $ kcadm.sh update realms/demorealm -s 'passwordPolicy="hashIterations(300000) and specialChars(2) and upperCase(2) and lowerCase(2) and digits(2) and length(9) and notUsername and passwordHistory(4)"'

現在のパスワードポリシーの取得

passwordPolicy 属性以外のすべての出力をフィルターすると、現在のレルム設定を取得できます。

たとえば、demorealmpasswordPolicy を表示します。

$ kcadm.sh get realms/demorealm --fields passwordPolicy

認証フローのリスト表示

authentication/flows エンドポイントで get コマンドを実行します。

以下に例を示します。

$ kcadm.sh get authentication/flows -r demorealm

特定の認証フローの取得

authentication/flows/FLOW_ID エンドポイントで get コマンドを実行します。

以下に例を示します。

$ 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

実行への設定の追加

  1. フローの実行を取得します。
  2. フローの ID をメモします。
  3. authentication/executions/{executionId}/config エンドポイントで create コマンドを実行します。

以下に例を示します。

$ kcadm.sh create "authentication/executions/a3147129-c402-4760-86d9-3f2345e401c7/config" -r demorealm -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"}'

実行設定の取得

  1. フローの実行を取得します。
  2. 設定 ID が含まれる authenticationConfig 属性をメモします。
  3. authentication/config/ID エンドポイントで get コマンドを実行します。

以下に例を示します。

$ kcadm get "authentication/config/dd91611a-d25c-421a-87e2-227c18421833" -r demorealm

実行設定の更新

  1. フローの実行を取得します。
  2. フローの authenticationConfig 属性を取得します。
  3. 属性の設定 ID をメモします。
  4. authentication/config/ID エンドポイントで update コマンドを実行します。

以下に例を示します。

$ kcadm update "authentication/config/dd91611a-d25c-421a-87e2-227c18421833" -r demorealm -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":""}}'

実行設定の削除

  1. フローの実行を取得します。
  2. フロー authenticationConfig 属性を取得します。
  3. 属性の設定 ID をメモします。
  4. authentication/config/ID エンドポイントで delete コマンドを実行します。

以下に例を示します。

$ kcadm delete "authentication/config/dd91611a-d25c-421a-87e2-227c18421833" -r demorealm
Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

© 2024 Red Hat, Inc.