# Cyberarkユーザーポータルからのインポート

<figure><img src="/files/ScwCWeAu35Rfo01iy70d" alt=""><figcaption></figcaption></figure>

KeeperコマンダーはCyberArkユーザーポータルにログインし、アプリケーションとセキュアアイテム (パスワードアイテムを含む) を取得し、それに対応するログインレコードをKeeperに自動的に作成します。

```bash
keeper import --format=cyberark_portal abc1234
```

## 認証

インポートプロセスでは最初にユーザー名の入力が求められ、その情報を使ってCyberArk Identity APIとの認証が開始されます。ユーザーが別のテナントに関連付けられている場合は処理が中断され、出力に正しいテナント名が表示されます。

```
CyberArk User Portal username: myusername
Use mytenantname instead of abc1234 for user myusername.
```

正しいテナント名を使用することで認証が続行できます。

### CyberArk Identityユーザー

ユーザーがCyberArkユーザーである場合、パスワードの入力が求められます。

```
keeper import --format=cyberark_portal mytenantname
CyberArk User Portal username: myusername
CyberArk Identity Portal password: *************
```

その後の認証プロセスは動的に行われ、多くの場合は追加認証ステップ (多要素認証の確認) が必要になります。例として、OATH OTPクライアントコードの入力が求められます。

```
keeper import --format=cyberark_portal mytenantname
CyberArk User Portal username: myusername
CyberArk Identity Portal password: *************
Authentication code from OATH OTP Client: 123456
```

すべての追加認証ステップを正常に完了すると、インポートプロセスが開始されます。

## フェデレーテッドログイン (SSO)

ユーザーがフェデレーテッドユーザー (SAMLやOpenID Connect (OIDC) を利用してCyberArkと統合されたIDプロバイダでログインしている場合)、インポート処理を実行するには、管理者権限を持つCyberArkユーザーがIdentity AdministrationポータルでKeeperコマンダー用のOAuth2クライアントアプリケーションを作成する必要があります。

### CyberArk OAuth2クライアントアプリケーションの作成手順

1. CyberArk Identity Administrationポータルにログイン
2. 左側メニューの \[Apps & Widgets] 内にある \[Web Apps] をクリック
3. 右上の \[Add Web Apps] ボタンをクリック
4. \[OAuth2 Client] の横にある \[Add] ボタンをクリックし、確認画面で \[Yes] ボタンをクリック<br>

   <figure><img src="/files/ucVJkk7MyRCzriT5jZgP" alt=""><figcaption></figcaption></figure>
5. \[Add Web Apps] ダイアログを閉じる
6. \[Application ID] に `KeeperCommander` と入力
7. \[Description] > \[Name] に `Keeper Commander OAuth2 Client` と入力
8. 左側メニューの \[General Usage] をクリックし、\[Client ID Type] で \[Anything] を選択
9. \[Allowed Redirects] の下にある \[Add] ボタンをクリックし、`http://localhost:38389` を追加<br>

   <figure><img src="/files/EbZcOEqsqgZEJufoiL38" alt=""><figcaption></figcaption></figure>
10. 左側メニューの \[Tokens] をクリックし、\[Implicit] のチェックを外す<br>

    <figure><img src="/files/65Ao7nqWvNheunzvRXvQ" alt=""><figcaption></figcaption></figure>
11. 左側メニューの \[Scopes] をクリックし、\[Authorized Scopes] の下にある \[Add] ボタンをクリック
12. 名前に `UPData` を入力し、\[Allowed REST APIs] の下にある \[Add] ボタンをクリック
13. REST正規表現に `UPRest/Get.*` を入力<br>

    <figure><img src="/files/MO0vaGYrsJNwhNVpSdl6" alt=""><figcaption></figcaption></figure>
14. \[Authorized Scopes] ダイアログで \[Save] ボタンをクリック
15. 左側メニューの \[Permissions] をクリック
16. \[Add] ボタンをクリックし、ユーザー・グループ・ロール選択ダイアログを使用して、対象ユーザーを追加し、(デフォルトの) \[Run] および \[Automatically Deploy] 権限を付与
17. \[Save] ボタンをクリック

Keeperコマンダーアプリケーションの \[Status] が緑色で「Deployed」と表示されていることを確認してください。

正しくデプロイされていない場合、ブラウザでの認証が成功してもエラーレスポンスが返され、インポート処理は中止されます。

<figure><img src="/files/wNUL9Oo5HrEMsl22pKRX" alt=""><figcaption></figcaption></figure>

### ブラウザ経由でのログイン

インポートプロセスがフェデレーテッドユーザーでの認証を開始すると、CyberArk Identity API はリダイレクトを返します。このリダイレクトはユーザーのローカルブラウザで処理され、ユーザー認証とOAuth2クライアントアプリケーションの承認が行われます。

<figure><img src="/files/6FpLWfa1aK6rfTbi0Ysa" alt=""><figcaption></figcaption></figure>

ユーザーが認証に成功すると、インポートプロセスはCyberArk Identity APIから返されたOAuth2認可コードを使用してアクセストークンを要求します。これにより、認証 (および認可) プロセスは完了します。

もしユーザーにKeeperコマンダーOAuth2クライアントアプリケーションの利用権限が与えられていない場合 (上記手順16参照)、`access_denied` エラーレスポンスが返され、処理は中止されます。

<figure><img src="/files/sCWMAVqCNLp8Dv7TfB4g" alt=""><figcaption></figcaption></figure>

### アイテムのインポート

インポートプロセスでは、まずアプリケーションの一覧を取得し、それぞれに対応するKeeperのログインレコードを作成します。次に、パスワードを含むセキュアアイテムについても同様に処理します。パスワードはログインレコードとしてインポートされ、その他のセキュアアイテムはセキュアノートとして取り込まれます。

```
Authentication successful
Importing 2 Applications:
 Application                              Username
---------------------------------------  ----------
My Network Provider | My Account         12345
NotAmazon.com • Login - myusername       myusername

Importing 2 Secured Items:
 Name
---------------
Sample password
Sample note

Import complete
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keeper.io/keeperpam/jp/commander-cli/command-reference/import-and-export-commands/cyberark-user-portal-import.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
