|
Lines 79-85
public class FormOpenIdAuthenticationService implements IAuthenticationService {
Link Here
|
| 79 |
|
79 |
|
| 80 |
private void setNotAuthenticated(HttpServletRequest req, HttpServletResponse resp, Properties properties) throws IOException { |
80 |
private void setNotAuthenticated(HttpServletRequest req, HttpServletResponse resp, Properties properties) throws IOException { |
| 81 |
resp.setHeader("WWW-Authenticate", HttpServletRequest.FORM_AUTH); //$NON-NLS-1$ |
81 |
resp.setHeader("WWW-Authenticate", HttpServletRequest.FORM_AUTH); //$NON-NLS-1$ |
| 82 |
resp.setStatus(HttpServletResponse.SC_UNAUTHORIZED); |
82 |
resp.setStatus(HttpServletResponse.SC_UNAUTHORIZED); |
| 83 |
|
83 |
|
| 84 |
// redirection from FormAuthenticationService.setNotAuthenticated |
84 |
// redirection from FormAuthenticationService.setNotAuthenticated |
| 85 |
String versionString = req.getHeader("Orion-Version"); //$NON-NLS-1$ |
85 |
String versionString = req.getHeader("Orion-Version"); //$NON-NLS-1$ |
|
Lines 90-100
public class FormOpenIdAuthenticationService implements IAuthenticationService {
Link Here
|
| 90 |
String xRequestedWith = req.getHeader("X-Requested-With"); //$NON-NLS-1$ |
90 |
String xRequestedWith = req.getHeader("X-Requested-With"); //$NON-NLS-1$ |
| 91 |
|
91 |
|
| 92 |
if (version == null && !"XMLHttpRequest".equals(xRequestedWith)) { //$NON-NLS-1$ |
92 |
if (version == null && !"XMLHttpRequest".equals(xRequestedWith)) { //$NON-NLS-1$ |
| 93 |
try { |
93 |
resp.sendRedirect(req.getContextPath() + "/mixloginstatic/LoginWindow.html?redirect=" + req.getRequestURL()); |
| 94 |
req.getRequestDispatcher("/mixloginstatic/LoginWindow.html").forward(req, resp); |
|
|
| 95 |
} catch (ServletException e) { |
| 96 |
LogHelper.log(new Status(IStatus.ERROR, Activator.PI_FORMOPENID_SERVLETS, 1, "An error occured during authenitcation", e)); |
| 97 |
} |
| 98 |
} else { |
94 |
} else { |
| 99 |
resp.setContentType(ProtocolConstants.CONTENT_TYPE_JSON); |
95 |
resp.setContentType(ProtocolConstants.CONTENT_TYPE_JSON); |
| 100 |
JSONObject result = new JSONObject(); |
96 |
JSONObject result = new JSONObject(); |
|
Lines 104-110
public class FormOpenIdAuthenticationService implements IAuthenticationService {
Link Here
|
| 104 |
} catch (JSONException e) { |
100 |
} catch (JSONException e) { |
| 105 |
LogHelper.log(new Status(IStatus.ERROR, Activator.PI_FORMOPENID_SERVLETS, 1, "An error occured during authenitcation", e)); |
101 |
LogHelper.log(new Status(IStatus.ERROR, Activator.PI_FORMOPENID_SERVLETS, 1, "An error occured during authenitcation", e)); |
| 106 |
} |
102 |
} |
| 107 |
resp.getWriter().print(result.toString()); |
103 |
resp.getWriter().print(result.toString()); |
| 108 |
} |
104 |
} |
| 109 |
} |
105 |
} |
| 110 |
|
106 |
|