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.
推薦閱讀
- Java范例大全
- Java系統分析與架構設計
- Spring技術內幕:深入解析Spring架構與設計
- Mastering Spring MVC 4
- FreeSWITCH 1.6 Cookbook
- 技術領導力:程序員如何才能帶團隊
- Monitoring Elasticsearch
- 面向對象程序設計(Java版)
- Building a Quadcopter with Arduino
- QTP自動化測試進階
- 微信小程序開發與實戰(微課版)
- Access 2010數據庫應用技術實驗指導與習題選解(第2版)
- Oracle 12c從入門到精通(視頻教學超值版)
- Blender 3D Cookbook
- Hands-On ROS for Robotics Programming