Search in sources :

Example 1 with OauthAuthorizeForm

use of org.orcid.pojo.ajaxForm.OauthAuthorizeForm in project ORCID-Source by ORCID.

the class OauthGenericCallsController method getEmptyAuthorizeForm.

@RequestMapping(value = "/oauth/custom/authorize/empty.json", method = RequestMethod.GET)
@ResponseBody
public OauthAuthorizeForm getEmptyAuthorizeForm(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException {
    OauthAuthorizeForm empty = new OauthAuthorizeForm();
    Text emptyText = Text.valueOf(StringUtils.EMPTY);
    empty.setPassword(emptyText);
    empty.setUserName(emptyText);
    RequestInfoForm requestInfoForm = getRequestInfoForm(request);
    if (requestInfoForm != null) {
        if (!PojoUtil.isEmpty(requestInfoForm.getUserId())) {
            empty.setUserName(Text.valueOf(requestInfoForm.getUserId()));
        }
    }
    return empty;
}
Also used : OauthAuthorizeForm(org.orcid.pojo.ajaxForm.OauthAuthorizeForm) RequestInfoForm(org.orcid.pojo.ajaxForm.RequestInfoForm) Text(org.orcid.pojo.ajaxForm.Text) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

OauthAuthorizeForm (org.orcid.pojo.ajaxForm.OauthAuthorizeForm)1 RequestInfoForm (org.orcid.pojo.ajaxForm.RequestInfoForm)1 Text (org.orcid.pojo.ajaxForm.Text)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1