Skip to content

Commit fb2b2b7

Browse files
authored
added changeRole documentation (#792)
1 parent ae29d3f commit fb2b2b7

File tree

1 file changed

+13
-3
lines changed
  • docs-source/spring/content/security/azn-server

1 file changed

+13
-3
lines changed

docs-source/spring/content/security/azn-server/_index.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,14 @@ The following REST Endpoints are available to manage users. The table lists whic
6464
| /user/api/v1/findUser | GET | Find all users | ROLE_ADMIN |
6565
| /user/api/v1/findUser?username=\<username\> | GET | Find a user with the username \<username\> | ROLE_ADMIN |
6666
| /user/api/v1/createUser | POST | Create a user | ROLE_ADMIN |
67-
| /user/api/v1/updatePassword | PUT | Update a password for a user. A user with<br>Role ROLE_ADMIN can update any users password | ROLE_USER |
67+
| /user/api/v1/updatePassword | PUT | Update a password for a user. A user with Role ROLE_ADMIN can update any users password | ROLE_USER |
68+
| /user/api/v1/changeRole | PUT | Change role(s) for a user | ROLE_ADMIN |
6869
| /user/api/v1/deleteUsername?username=\<username\> | DELETE | Delete a user with username \<username\> | ROLE_ADMIN |
6970
| /user/api/v1/deleteId?id=\<id\> | DELETE | Delete a user with the id \<id\> | ROLE_ADMIN |
7071

7172
### User Management REST Endpoints
7273

73-
In all examples below you need to replace `<username>:<password>` with your username and password. The examples are using `curl` to interact with the REST endpoints. They also requires that you have opened a tunnel on port 8080 to either the `azn-server` or `obaas-admin` service. For example
74+
In all examples below you need to replace `<username>:<password>` with your username and password. The examples are using `curl` to interact with the REST endpoints. They also requires that you have opened a tunnel on port 8080 to either the `azn-server` or `obaas-admin` service. For example, this command opens a tunnel to the `obaas-admin` service.
7475

7576
```shell
7677
kubectl port-forward -n obaas-admin svc/obaas-admin 8080
@@ -104,10 +105,19 @@ curl -u <username>:<password> -i -X POST \
104105
```shell
105106
curl -u <username>:<password> -i -X PUT \
106107
-H 'Content-Type: application/json' \
107-
-d '{"username": "a-new-user", "password": "more-top-secret-password"}' \
108+
-d '{"username": "current-user", "password": "more-top-secret-password"}' \
108109
http://localhost:8080/user/api/v1/updatePassword
109110
```
110111

112+
#### /user/api/v1/changeRole
113+
114+
```shell
115+
curl -u <username>:<password> -i -X PUT \
116+
-H 'Content-Type: application/json' \
117+
-d '{"username": "current-user", "roles": "changed-roles"}' \
118+
http://localhost:8080/user/api/v1/changeRole
119+
```
120+
111121
#### /user/api/v1/deleteUsername?username=\<username\>
112122

113123
```shell

0 commit comments

Comments
 (0)