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.
推薦閱讀
- Cocos2D-X權(quán)威指南(第2版)
- Java高手真經(jīng)(高級(jí)編程卷):Java Web高級(jí)開(kāi)發(fā)技術(shù)
- 深入淺出Windows API程序設(shè)計(jì):編程基礎(chǔ)篇
- Hands-On Reinforcement Learning with Python
- Serverless computing in Azure with .NET
- Raspberry Pi Home Automation with Arduino(Second Edition)
- 領(lǐng)域驅(qū)動(dòng)設(shè)計(jì):軟件核心復(fù)雜性應(yīng)對(duì)之道(修訂版)
- Advanced Express Web Application Development
- Python入門很輕松(微課超值版)
- MySQL程序員面試筆試寶典
- OpenCV with Python Blueprints
- 青少年P(guān)ython趣味編程
- RESTful Web API Design with Node.js(Second Edition)
- jBPM6 Developer Guide
- Unity與C++網(wǎng)絡(luò)游戲開(kāi)發(fā)實(shí)戰(zhàn):基于VR、AI與分布式架構(gòu)