@Override public boolean resolve(HttpServerExchange value) { SecurityContext sc = value.getSecurityContext(); if(sc == null) { return false; } return sc.isAuthenticationRequired(); }
/** * <p>The authentication is mandatory if the servlet has http constraints (eg.: {@link * javax.servlet.annotation.HttpConstraint}).</p> * * @param attachment * @return */ private Boolean isMandatory(final ServletRequestContext attachment) { return attachment.getExchange().getSecurityContext() != null && attachment.getExchange().getSecurityContext().isAuthenticationRequired(); }
private Certificate[] getPeerCertificates(final HttpServerExchange exchange, SSLSessionInfo sslSession, SecurityContext securityContext) throws SSLPeerUnverifiedException { try { return sslSession.getPeerCertificates(); } catch (RenegotiationRequiredException e) { //we only renegotiate if authentication is required if (forceRenegotiation && securityContext.isAuthenticationRequired()) { try { sslSession.renegotiate(exchange, SslClientAuthMode.REQUESTED); return sslSession.getPeerCertificates(); } catch (IOException e1) { //ignore } catch (RenegotiationRequiredException e1) { //ignore } } } throw new SSLPeerUnverifiedException(""); }
@Override public boolean resolve(HttpServerExchange value) { SecurityContext sc = value.getSecurityContext(); if(sc == null) { return false; } return sc.isAuthenticationRequired(); }
@Override public boolean resolve(HttpServerExchange value) { SecurityContext sc = value.getSecurityContext(); if(sc == null) { return false; } return sc.isAuthenticationRequired(); }
/** * <p>The authentication is mandatory if the servlet has http constraints (eg.: {@link * javax.servlet.annotation.HttpConstraint}).</p> * * @param attachment * @return */ private Boolean isMandatory(final ServletRequestContext attachment) { return attachment.getExchange().getSecurityContext() != null && attachment.getExchange().getSecurityContext().isAuthenticationRequired(); }
/** * <p>The authentication is mandatory if the servlet has http constraints (eg.: {@link * javax.servlet.annotation.HttpConstraint}).</p> * * @param attachment * @return */ private Boolean isMandatory(final ServletRequestContext attachment) { return attachment.getExchange().getSecurityContext() != null && attachment.getExchange().getSecurityContext().isAuthenticationRequired(); }
private Certificate[] getPeerCertificates(final HttpServerExchange exchange, SSLSessionInfo sslSession, SecurityContext securityContext) throws SSLPeerUnverifiedException { try { return sslSession.getPeerCertificates(); } catch (RenegotiationRequiredException e) { //we only renegotiate if authentication is required if (forceRenegotiation && securityContext.isAuthenticationRequired()) { try { sslSession.renegotiate(exchange, SslClientAuthMode.REQUESTED); return sslSession.getPeerCertificates(); } catch (IOException e1) { //ignore } catch (RenegotiationRequiredException e1) { //ignore } } } throw new SSLPeerUnverifiedException(""); }
private Certificate[] getPeerCertificates(HttpServerExchange exchange, SSLSessionInfo sslSession, SecurityContext securityContext) throws SSLPeerUnverifiedException { try { return sslSession.getPeerCertificates(); } catch (RenegotiationRequiredException e) { // we only renegotiate if authentication is required if (forceRenegotiation && securityContext.isAuthenticationRequired()) { try { sslSession.renegotiate(exchange, SslClientAuthMode.REQUESTED); return sslSession.getPeerCertificates(); } catch (IOException | RenegotiationRequiredException e1) { // ignore } } } throw new SSLPeerUnverifiedException(""); }
private Certificate[] getPeerCertificates(final HttpServerExchange exchange, SSLSessionInfo sslSession, SecurityContext securityContext) throws SSLPeerUnverifiedException { try { return sslSession.getPeerCertificates(); } catch (RenegotiationRequiredException e) { //we only renegotiate if authentication is required if (forceRenegotiation && securityContext.isAuthenticationRequired()) { try { sslSession.renegotiate(exchange, SslClientAuthMode.REQUESTED); return sslSession.getPeerCertificates(); } catch (IOException e1) { //ignore } catch (RenegotiationRequiredException e1) { //ignore } } } throw new SSLPeerUnverifiedException(""); }