|
|
@@ -71,6 +71,25 @@ public class OauthAction extends StandardJaxrsAction {
|
|
|
asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
|
|
|
}
|
|
|
|
|
|
+ @JaxrsMethodDescribe(value = "POST方法实现oauth认证token方法", action = ActionToken.class)
|
|
|
+ @POST
|
|
|
+ @Path("token/jira")
|
|
|
+ @Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
|
|
|
+ @Consumes({ MediaType.MULTIPART_FORM_DATA, MediaType.APPLICATION_FORM_URLENCODED, MediaType.APPLICATION_JSON })
|
|
|
+ public void postTokenJson(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
|
|
|
+ @Context HttpServletResponse response, @FormParam("code") String code,
|
|
|
+ @FormParam("grant_type") String grant_type) {
|
|
|
+ ActionResult<ActionToken.Wo> result = new ActionResult<>();
|
|
|
+ EffectivePerson effectivePerson = this.effectivePerson(request);
|
|
|
+ try {
|
|
|
+ result = new ActionToken().execute(effectivePerson, code, grant_type, MediaType.APPLICATION_JSON);
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error(e, effectivePerson, request, null);
|
|
|
+ result.error(e);
|
|
|
+ }
|
|
|
+ asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
|
|
|
+ }
|
|
|
+
|
|
|
@JaxrsMethodDescribe(value = "GET方法实现oauth认证token方法", action = ActionToken.class)
|
|
|
@GET
|
|
|
@Path("token")
|