简体   繁体   English

Jhipster 自动生成的 Java 应用程序中 JWT 身份验证的顺序是什么?

[英]What is the order of JWT Authentication in Jhipster autogenerated Java application?

I am new to JWT authentication.我是 JWT 身份验证的新手。 I can use the default Admin credentials for accessing the API's.我可以使用默认管理员凭据来访问 API。 Where most of them use, but I don't how to register and add a user within the application.他们中的大多数人都在哪里使用,但我不知道如何在应用程序中注册和添加用户。

Do someone have a postman collections or can someone help to with the flow?有人有 postman collections 或者有人可以帮忙吗?

After you login to Gateway web application as an admin user,以管理员用户身份登录网关 web 应用程序后,

Option 1 [What OP wants]选项 1 [OP 想要什么]

Go to Administration -> API Menu which will bring you to the swagger documentation page and then select the default definition on the top right drop down. Go to Administration -> API Menu which will bring you to the swagger documentation page and then select the default definition on the top right drop down. The 'user-resource' section should have all the Rest end points you are looking for with its definitions. “用户资源”部分应该包含您正在寻找的所有 Rest 端点及其定义。 Sample curl from this page for user creation,来自此页面的示例 curl 用于用户创建,

 curl -X POST "http://localhost:8080/api/users" -H "accept: */*" -H "Content-Type: application/json" -H "Authorization: Bearer xcxcxcx.xcxcxcxc.xcxcxcxc" -d "{ \"login\": \"sampleUser\", \"firstName\": \"Sample\", \"lastName\": \"User\", \"email\": \"sampleUser@localhost\", \"imageUrl\": \"\", \"activated\": true, \"langKey\": \"en\", \"createdBy\": \"system\", \"createdDate\": null, \"lastModifiedBy\": \"system\", \"lastModifiedDate\": null, \"authorities\": [ \"ROLE_USER\", \"ROLE_ADMIN\" ] }"

Using this page you should be able to get all that you need.使用此页面,您应该能够获得所需的一切。

Option 2选项 2

Go to Administration -> User Management Menu on the top right and you should be able to add/update/delete users. Go 到右上角的管理 -> 用户管理菜单,您应该能够添加/更新/删除用户。

See this video @1:45 video link观看此视频@1:45视频链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM