This repository has been archived by the owner on Jul 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
curl.txt
50 lines (35 loc) · 1.97 KB
/
curl.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Examples of curl commands for using security-token-service functionality
In all commands, host and port must be set, the examples use localhost:9001 for running from local core-os machine
Check the specific command section to see what more parameters should be changed
=== Tenants ===
Create tenant
curl -H "Content-Type: application/json" -d '{"adminUserName": "[email protected]"}' http://localhost:9001/sts/tenant
>>> NOTE - should be set: adminUserName
Get tenant by admin user name name
curl -H "Accept: application/json" http://localhost:9001/sts/tenant?user={adminUserName}
>>> NOTE - should be set: adminUserName
Delete tenant by id
curl -X DELETE http://localhost:9001/sts/tenant/1
>>> NOTE - should be set: tenantId
==== Clients =====
Create client
curl -H "Content-Type: application/json" -d '{"client_id": "restapp","client_secret": "secret","scope": "read,write,trust","authorized_grant_types": "client_credentials","authorities": "ROLE_APP","tenantId": 33}' http://localhost:9001/sts/oauth/client
>>> NOTE - should be set: client_id, client_secret, tenantId
Get client by ID:
curl -H "Accept: application/json" http://localhost:9001/sts/oauth/client/restapp
>>> NOTE - should be set: client_id
Get all clients:
curl -H "Accept: application/json" http://localhost:9001/sts/oauth/client
Delete client by ID:
curl -X DELETE http://localhost:9001/sts/oauth/client/restapp2
>>> NOTE - should be set: client_id
==== Tokens ====
Create token:
curl -v -H "Accept: application/json" -H "Content-Type: application/json" -X POST "http://localhost:9001/sts/oauth/token?grant_type=client_credentials&client_id=restapp&client_secret=secret"
>>> NOTE - should be set: client_id, client_secret
Check token:
curl -v -H "Accept: application/json" http://localhost:9001/sts/oauth/check_token?token=62ad16cf-ab6c-42fa-af3d-359ecf98cdec
>>> NOTE - should be set: token
Revoke token:
curl -v -X DELETE http://localhost:9001/sts/oauth/token/revoke?token=392df810-c616-4f8c-b190-604c9aaf85d8
>>> NOTE - should be set: token