Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

curl rest api keycloak

#!/bin/bash

echo "* Request for authorization"
RESULT=`curl --data "username=admin&password=Pa55w0rd&grant_type=password&client_id=admin-cli" http://localhost:8080/auth/realms/master/protocol/openid-connect/token`

echo "
"
echo "* Recovery of the token"
TOKEN=`echo $RESULT | sed 's/.*access_token":"//g' | sed 's/".*//g'`

echo "
"
echo "* Display token"
echo $TOKEN

echo "
"
echo " * user creation
"
curl -v http://localhost:8080/auth/admin/realms/apiv2/users -H "Content-Type: application/json" -H "Authorization: bearer $TOKEN"   --data '{"firstName":"xyz","lastName":"xyz", "email":"demo2@gmail.com", "enabled":"true"}'
Comment

PREVIOUS NEXT
Code Example
Csharp :: How to install a windows service programmatically in C#? 
Csharp :: convert list to datatable c# 
Csharp :: rename join table ef core 
Csharp :: c# enum to list of strings 
Csharp :: unity easing out 
Csharp :: discord embeds how to separate inline fields 
Csharp :: c# press ctrl and alt 
Csharp :: wpf StrokeDashArray 
Csharp :: length of list c# 
Csharp :: raq query ef core 
Csharp :: How to change ListBox selection background color 
Csharp :: c# system cryptography hash string 
Csharp :: concatenate two lists in c# 
Csharp :: c# check if string contains character multiple times 
Csharp :: create list of strings from field of list of object c# 
Csharp :: c# slice array 
Csharp :: selenum wait for element c# 
Csharp :: how to call last string from text file C# 
Csharp :: how to show a first item in a combobox in c# winforms 
Csharp :: c# convert bitmap to image 
Csharp :: escape in c# 
Csharp :: change a positive number to negative or a negative number to positive 
Csharp :: How can I get my stripe customer ID? 
Csharp :: add to ienumerable 
Csharp :: concatenation on different lines in f# 
Csharp :: why does everything reset when switching scene unity 
Csharp :: c# predicate 
Csharp :: remove loading bars devexpress on callback 
Csharp :: mvc form name 
Csharp :: how to get user browser information in .net core 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =