1

私はこのようなAPIを持っています

@GET
@Path("/tasks")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@io.swagger.annotations.ApiOperation(value = "List all tasks", notes = "", response = Tasks.class, authorizations = {
@io.swagger.annotations.Authorization(value = "api_key")
}, tags={ "tasks",  })
@io.swagger.annotations.ApiResponses(value = { 
@io.swagger.annotations.ApiResponse(code = 200, message = "An array of tasks", response = Tasks.class),
@io.swagger.annotations.ApiResponse(code = 200, message = "unexpected error", response = Tasks.class) })
public Response getTasks(@Context SecurityContext securityContext) throws NotFoundException {
    return delegate.getTasks(securityContext);
}

パラメータは Jersey SecurityContext です。私の質問は、このセキュリティコンテキストで何ができるでしょうか? そして、この API へのリクエストはどのように見えますか?

このhttps://jersey.java.net/documentation/latest/security.htmlを読みましたが、 SecurityContext を完全に理解していませんでした。

望ましい動作は、可能であれば、ユーザーとキーのような文字列として 2 つの情報を送信することです。

4

0 に答える 0