Skip to main content

Set Of Useful Curl Commands

Below is a set of curl commands, that are helpful developing BDDK Integration

Getting Access Token

see here

Add App

see Add App and the full details

Create App Version

see Create or Add App Version and with more details

Create User Command

curl --location --request POST 'https://domain/auth/admin/realms/{realm}/users' \ 
--header 'Content-Type: application/json' \
--data-raw '{
"username": "john@gamil.com",
"credentials": [
{
"type": "password",
"value": "john@123",
"temporary": false
}
],
"email": "john@gamil.com",
"enabled": true,
"emailVerified": false,
"firstName": "John",
"lastName": "J"
}'

Location for more details

** create user https://developer.kobil.com/docs/api/users/createuser#http-request-url-for-shift ** update user https://developer.kobil.com/docs/api/users/updateuser#http-request-url-for-shift

Get User using UUID

curl --location --request GET 'https://idp.<HOST>/auth/admin/realms/{realm}/users/{uuid}' \
--header 'Authorization: Bearer {token}'

Get User using user name

curl --location --request GET 'https://idp.<HOST>/auth/realms/{realm}/v3_user/{username}' \
--header 'Authorization: Bearer {token}'

Delete User

curl --location -g --request DELETE 'https://idp.<HOST>/admin/realms/{tenant}/users/{{userId}}' \ 
--header 'Authorization: Bearer {token}'

Example Delete User

curl --location --globoff --request DELETE 'https://idp.monaco-cbe-shift-a7yt7.midentity.dev/auth/realms/grootan/v3_user/john@gamil.com' \ 
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJSd1RCV080dmFNdnlFT19IMkNlY0xDN3Fmc09KMjhoQkVDTG1BWUN0R3BZIn0.eyJleHAiOjE2ODg2NDI0OTQsImlhdCI6MTY4ODY0MTU5NCwianRpIjoiYmFhMTNlYTctYzUxZS00YTQ0LWEyOTEtNzIzYTk5MDEzOGYxIiwiaXNzIjoiaHR0cHM6Ly9pZHAubW9uYWNvLWNiZS1zaGlmdC1hN3l0Ny5taWRlbnRpdHkuZGV2L2F1dGgvcmVhbG1zL2dyb290YW4iLCJhdWQiOiJhY2NvdW50Iiwic3ViIjoiM2M1NTI4ZjItNTk4ZS00MWY0LThjM2UtYWRmYTIyYWI3ODI3IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiSURQQ2hhbmdlRW1haWxIZWFkbGVzc1YyIiwic2Vzc2lvbl9zdGF0ZSI6ImRlMmFhMjM5LTFkNGItNGRhZi04NjBlLTRlMDk0ZmRiYmExZSIsImFjciI6Ii0xIiwiYW1yIjpbXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbImRlZmF1bHQtcm9sZXMtZ3Jvb3RhbiIsIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkaWdpdGFuaXVtX2FkbWluIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJlbWFpbCBwcm9maWxlIGFjci0xIiwic2lkIjoiZGUyYWEyMzktMWQ0Yi00ZGFmLTg2MGUtNGUwOTRmZGJiYTFlIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiIxIn0.Ea4bRyp4OypXNTyodWAsFfXwZVk2DptCq5t5Aygwiglu8tqAedQaKYLgHRrYTAEEvswoVbJ8MZxi28q3x5eiAe_fyyLnSHSIXazgjgmmhRsXaxTOv2FF5gZqK5iQlsgMrpWde4CQdwHYtES8oebBzyWekc9UaqLtl2kB-gB2dmejca9wE_3Q1k3kaZU_yjaulTCFVeJA9fW7iWxTZ9U_X5jS0MXcPbU9hilkuRbdOkG-i6BniYfzR0TRi04Sc96wl4BVc-9EGNAIG77QCpIMpakWzI6JlXawcPrKvnLyt8dWtj2OoKRQABuO9_5l-DS1aK27pAJYrM4ox7cuOmXuLw' 

Create Activation Key

curl --location --request PUT 'http://domain/auth/admin/realms/{tenant}/users/{userid}' \ 
--header 'Content-Type: application/json' \ 
--header 'Authorization: Bearer {token}' \ 
--data-raw '{ 
     
     "credentials" : [ 
         {    
             "type" : "otp", 
             "credentialData" : "{\"subType\" : \"totp\" , \"period\" : \"1687277520\"}", 
             "secretData" : "{\"value\" : \"123456\"}" 
         } 
     ] 
}' 

Create Activation Code Sample

curl --location --request PUT 'http://localhost:8080/auth/admin/realms/test/users/6c18fd3b-8c84-4ada-843e-ad6c80b04321' \ 
--header 'Content-Type: application/json' \ 
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJLemtBZ0ZrMG9sZDh3UEZob3BwY0c3a3piWFJBNDBvc2dGWUFfeThHS3lNIn0.eyJleHAiOjE2ODkzNDUzMTMsImlhdCI6MTY4OTM0NTAxMywianRpIjoiZjdjMTE0OGYtMTYwYi00NTM5LWI0ZTYtMGVkOGM5ZDU3YzA4IiwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo4MDgwL2F1dGgvcmVhbG1zL3Rlc3QiLCJzdWIiOiJkMmU4ZDE1Zi0xOThiLTQ0MTktYjA1ZC01MjU5ODBhN2Q2MTYiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJhZG1pbi1jbGkiLCJzZXNzaW9uX3N0YXRlIjoiYmQ3ZGNlNTYtODUyZi00NDhjLWJmZDItNWZhMTk1YmFlOWFiIiwiYWNyIjoiLTEiLCJhbXIiOltdLCJzY29wZSI6ImVtYWlsIHByb2ZpbGUgYWNyLTEiLCJzaWQiOiJiZDdkY2U1Ni04NTJmLTQ0OGMtYmZkMi01ZmExOTViYWU5YWIiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsIm5hbWUiOiJiaGFyYXRoIGsiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJiaGFyYXRoLmsiLCJnaXZlbl9uYW1lIjoiYmhhcmF0aCIsImZhbWlseV9uYW1lIjoiayIsImVtYWlsIjoiYmhhcmF0aC5rQGdyb290YW4uY29tIn0.iqkDU760p182RRk0dv93aplHcvlj5meqmKbyKuhY4CrPo29jBdVvOQaJbsvecACziyjt8E7www6hxwTXMEG2l9ywtVqW1FWqgpR1ZorUfhd-juAk6gJBjcOTCeMNUJgGjBEbnora5EfmvIhsDHNJCMIJkLsqWZ-x3Pj1s0LlLGgESikeiSsQJ1930tA9OHVU0ksavFz-lcM5KlhV_6mqjsO6bl4-EhLoV1Pp4eSSPqd7BzEvLFcU7ITFKEC4dt9GIX8zEUlLNuHLWu7wLkacz91DVNtSA-pwtqT-ImmFyXVcvkvDF5Z7QwBVd2ChLFqmLANH-0_upE2M0Os1pL2uOg' \ 
--data-raw '{ 
     "credentials" : [ 
         {    
             "type" : "otp", 
             "credentialData" : "{\"subType\" : \"totp\" , \"period\" : \"1687277520\"}", 
             "secretData" : "{\"value\" : \"123456\"}" 
         } 
     ] 
}' 

Additional commands:

TMS

Note:

The JSON for credential data and secret data should be stringified (with escape chars).  This is a IDP API core and it requires to be in this format