npm install -g n
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AjaxAwareAuthenticationEntryPoint extends LoginUrlAuthenticationEntryPoint { | |
public AjaxAwareAuthenticationEntryPoint(String loginFormUrl) { | |
super(loginFormUrl); | |
} | |
@Override | |
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { | |
String ajaxHeader = ((HttpServletRequest) request).getHeader("X-Requested-With"); | |
if ("XMLHttpRequest".equals(ajaxHeader)) { | |
response.sendError(HttpServletResponse.SC_FORBIDDEN, "Ajax Request Denied (Session Expired)"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create new configuration that specifies the error correction | |
Map<EncodeHintType, ErrorCorrectionLevel> hints = new HashMap<EncodeHintType, ErrorCorrectionLevel>(); | |
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); | |
QRCodeWriter writer = new QRCodeWriter(); | |
BitMatrix bitMatrix = null; | |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
try { | |
// Create a qr code with the url as content and a size of 250x250 px |