Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
c30f4413
Commit
c30f4413
authored
6 years ago
by
wojiushixiaobai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update
parent
5783baa6
docs
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
user_api.rst
docs/user_api.rst
+5
-1
No files found.
docs/user_api.rst
View file @
c30f4413
...
...
@@ -17,7 +17,11 @@ API 文档
.. code-block:: shell
$ curl -X POST -H 'Content-Type: application/json' -d '{"username": "admin", "password": "admin"}' http://localhost/api/users/v1/auth/ # 获取token
{"Token":"937b38011acf499eb474e2fecb424ab3"}% # 获取到的token
{"token":"937b38011acf499eb474e2fecb424ab3"}% # 获取到的token
# 如果开启了 MFA, 则返回的是 seed, 需要携带 seed 和 otp_code 再次提交一次才能获取到 token
$ curl -X POST -H 'Content-Type: application/json' -H 'cache-control: no-cache' -d '{"seed": "629ba0935a624bd9b21e31c19e0cc8cb", "otp_code": "202123"}'
{"token":"937b38011acf499eb474e2fecb424ab3"}%
$ curl -H 'Authorization: Bearer 937b38011acf499eb474e2fecb424ab3' -H "Content-Type:application/json" http://localhost/api/users/v1/users/
# 使用token访问,token有效期 1小时
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment