- OpenDaylight Cookbook
- Mathieu Lemay Alexis de Talhou?t Jamie Goodyear Rashmi Pujar Mohamed El Serngawy Yrineu Rodrigues
- 239字
- 2021-07-02 21:38:38
How to do it...
Perform the following steps:
- Start your OpenDaylight distribution using the karaf script. Using this script will give you access to the Karaf CLI:
$ ./bin/karaf
- Install the user-facing feature, responsible for pulling in all dependencies needed to enable user authentication:
opendaylight-user@root>feature:install odl-aaa-authn
It might take a few minutes to complete the installation.
- To retrieve the list of existing users, send the following request:
- Type: GET
- Headers:
Authorization: Basic YWRtaW46YWRtaW4=
- URL: http://localhost:8181/auth/v1/users
{
"users": [
{
"userid": "admin@sdn",
"name": "admin",
"description": "admin user",
"enabled": true,
"email": "",
"password": "**********",
"salt": "**********",
"domainid": "sdn"
},
{
"userid": "user@sdn",
"name": "user",
"description": "user user",
"enabled": true,
"email": "",
"password": "**********",
"salt": "**********",
"domainid": "sdn"
}
]
}
- Update the configuration of a user.
First, you need the userid that can be retrieved using the previous request. For this tutorial, we will use userid=user@sdn.
To update the password for this user, do the following request:
- Type: PUT
- Headers:
Authorization: Basic YWRtaW46YWRtaW4=
This is the basic admin/admin authorization. We will not modify this one.
- Payload:
{
"userid": "user@sdn",
"name": "user",
"description": "user user",
"enabled": true,
"email": "",
"password": "newpassword",
"domainid": "sdn"
}
- URL: http://localhost:8181/auth/v1/users/user@sdn
Once sent, you will receive the acknowledged payload.
- Try your new user's password. Open your browser and go here http://localhost:8181/auth/v1/users, you should be asked for credentials. Use:
- Username: user
- Password: newpassword
You should now be logged in with the new, updated password for the user.
推薦閱讀
- 編程卓越之道(卷3):軟件工程化
- Python網絡爬蟲從入門到實踐(第2版)
- INSTANT Sencha Touch
- 鋒利的SQL(第2版)
- 精通網絡視頻核心開發技術
- Instant PHP Web Scraping
- 現代C++編程實戰:132個核心技巧示例(原書第2版)
- Spring 5 Design Patterns
- Arduino可穿戴設備開發
- Java Hibernate Cookbook
- IBM DB2 9.7 Advanced Application Developer Cookbook
- 威脅建模:設計和交付更安全的軟件
- C語言程序設計教程
- Swift語言實戰晉級(第2版)
- Visual FoxPro程序設計教程(第3版)