-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_token.txt
23 lines (17 loc) · 1.17 KB
/
get_token.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
curl --location --request POST 'http://{your-keycloak-server}/auth/realms/{realm}/protocol/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id={your-client-id}' \
--data-urlencode 'client_secret={your-client-secret}'
==================================================================
curl --location --request POST 'http://localhost:8080/realms/myrealm/protocol/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=confidential-client' \
--data-urlencode 'client_secret=dYldgV0QOxFDGViOmw2sIsYcRwpI7apL' \
curl --location --request POST 'http://localhost:8080/realms/myrealm/protocol/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'grant_type=client_credentials&client_id=confidential-client&client_secret=dYldgV0QOxFDGViOmw2sIsYcRwpI7apL'
==================================================================
curl --location --request GET 'http://{your-api-server-endpoint}' \
--header 'Authorization: Bearer {access-token}'