gpt4 book ai didi

java - JAX-RS 授权获取更多数据

转载 作者:行者123 更新时间:2023-12-01 12:53:37 25 4
gpt4 key购买 nike

我正在使用 Java 和 Glassfish 4 编写 RESTful Web 服务。我成功设置了 jdbc 领域。我可以通过 web.xml 锁定某些 URL。现在我想要一个资源,如果用户是否被授权,它的值就会改变。示例:

**Request:** 
exampleuser/information
GET without BASIC Auth

**Response:**
username: example user
email: example@user.com

**Request:**
exampleuser/information
GET with BASIC Auth as exampleuser

**Response:**
username: example user
email: example@user.com
born: 1.1.1111
password: test

所以我想以某种方式检查该方法是否用户被授权,并基于此我想返回其他信息。这怎么可能?

最佳答案

看看这个 link ,应该对你有帮助

关于java - JAX-RS 授权获取更多数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24040353/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com