3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

IBM Security Verify API で ユーザーを削除する

Last updated at Posted at 2021-06-01

はじめに

IBM Security Verify APIを利用して、ユーザーを削除する方法についてご紹介いたします。

APIのリファレンス

APIのリファレンスは、以下のURLから確認できます。
https://<自分のテナント名>.verify.ibm.com/developer/explorer/#

  • ユーザーの取得に利用するAPIは、以下の項目になります。
    • Users Management Version 2.0

APIに関するKCのヘルプはこちらです。
https://www.ibm.com/support/knowledgecenter/ja/SSCT62/com.ibm.iamservice.doc/concepts/apis.html

1.IBM Security VerifyへのAPIクライアントの登録

OAuth アクセストークンを取得するために使用するクライアント ID とクライアントシークレットを準備します。
ブラウザで、IBM Security Verifyの管理画面にアクセスします。
https://<自分のテナント名>.verify.ibm.com/ui/admin

「構成」-「API クライアント」タブを開き、「APIクライアントの追加」をクリックします。
OTP-000002.png

アクセス件を与えるAPIとしては以下を選択して、「保存」します。
- ユーザーおよび標準グループの管理

userdel2.png

登録したAPIクライアントを編集モードにすると、クライアントID/クライアント秘密鍵をコピーできます。
userdel3.png

2.アクセストークンの取得

curl -X POST "https://<テナント名>.verify.ibm.com/oidc/endpoint/default/token" --header "Content-Type: application/x-www-form-urlencoded" --data-urlencode "grant_type=client_credentials" --data-urlencode "client_id=<クライアントID>" --data-urlencode "client_secret=<クライアント秘密鍵>"

取得したアクセストークンは赤枠部分になります。
qiita (2).png

3.ユーザーの削除

ユーザーを削除するためには、以下のコマンドを実行します。

curl -i -X DELETE https://<テナント名>.verify.ibm.com/v2.0/Users/<ユーザーID> --header "Authorization: Bearer <アクセストークン>"

レスポンスコードは204になります。
userdel1.png

最後に

IBM Security VerifyのAPIを利用してアカウントを削除する方法についてご紹介しました。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?