@Test public void shouldValidateRequestWithCookiesNull() throws AuthException { MessageInfo messageInfo = mock(MessageInfo.class); Subject clientSubject = new Subject(); Subject serviceSubject = new Subject(); HttpServletRequest request = mock(HttpServletRequest.class); given(messageInfo.getRequestMessage()).willReturn(request); AuthStatus authStatus = localSSOTokenSessionModule.validateRequest(messageInfo, clientSubject, serviceSubject); assertEquals(authStatus, AuthStatus.SEND_FAILURE); }
@Override public AuthStatus validateRequest(final MessageInfo messageInfo, final Subject clientSubject, Subject serviceSubject) throws AuthException { if (!isInitialised()) { initDependencies(); } final HttpServletRequest request = (HttpServletRequest) messageInfo.getRequestMessage(); String requester = request.getParameter(REQUESTER_URL_PARAM); if (requester != null) { try { SSOToken requesterToken = getFactory().getTokenFromId(requester); if (getFactory().isTokenValid(requesterToken)) { Object o = RestrictedTokenContext.doUsing(requesterToken, new RestrictedTokenAction() { public Object run() throws Exception { return validate(request, messageInfo, clientSubject); } }); return (AuthStatus) o; } } catch (Exception ex) { throw new AuthException("An error occurred whilst trying to use restricted token."); } } return validate(request, messageInfo, clientSubject); }
LocalSSOTokenSessionModule implements ServerAuthModule { @Override public AuthStatus validateRequest(final MessageInfo messageInfo, final Subject clientSubject, Subject serviceSubject) throws AuthException { if (!isInitialised()) { initDependencies(); } final HttpServletRequest request = (HttpServletRequest) messageInfo.getRequestMessage(); String requester = request.getParameter(REQUESTER_URL_PARAM); if (requester != null) { try { SSOToken requesterToken = getFactory().getTokenFromId(requester); if (getFactory().isTokenValid(requesterToken)) { Object o = RestrictedTokenContext.doUsing(requesterToken, new RestrictedTokenAction() { public Object run() throws Exception { return validate(request, messageInfo, clientSubject); } }); return (AuthStatus) o; } } catch (Exception ex) { throw new AuthException("An error occurred whilst trying to use restricted token."); } } return validate(request, messageInfo, clientSubject); } }
LocalSSOTokenSessionModule implements ServerAuthModule { @Override public AuthStatus validateRequest(final MessageInfo messageInfo, final Subject clientSubject, Subject serviceSubject) throws AuthException { if (!isInitialised()) { initDependencies(); } final HttpServletRequest request = (HttpServletRequest) messageInfo.getRequestMessage(); String requester = request.getParameter(REQUESTER_URL_PARAM); if (requester != null) { try { SSOToken requesterToken = getFactory().getTokenFromId(requester); if (getFactory().isTokenValid(requesterToken)) { Object o = RestrictedTokenContext.doUsing(requesterToken, new RestrictedTokenAction() { public Object run() throws Exception { return validate(request, messageInfo, clientSubject); } }); return (AuthStatus) o; } } catch (Exception ex) { throw new AuthException("An error occurred whilst trying to use restricted token."); } } return validate(request, messageInfo, clientSubject); } LocalSSOTokenSessionModule();  LocalSSOTokenSessionModule(AuthnRequestUtils requestUtils, SSOTokenFactory factory,
            AuthUtilsWrapper authUtilsWrapper); }
LocalSSOTokenSessionModule implements ServerAuthModule { @Override public AuthStatus validateRequest(final MessageInfo messageInfo, final Subject clientSubject, Subject serviceSubject) throws AuthException { if (!isInitialised()) { initDependencies(); } final HttpServletRequest request = (HttpServletRequest) messageInfo.getRequestMessage(); String requester = request.getParameter(REQUESTER_URL_PARAM); if (requester != null) { try { SSOToken requesterToken = getFactory().getTokenFromId(requester); if (getFactory().isTokenValid(requesterToken)) { Object o = RestrictedTokenContext.doUsing(requesterToken, new RestrictedTokenAction() { public Object run() throws Exception { return validate(request, messageInfo, clientSubject); } }); return (AuthStatus) o; } } catch (Exception ex) { throw new AuthException("An error occurred whilst trying to use restricted token."); } } return validate(request, messageInfo, clientSubject); } LocalSSOTokenSessionModule();  LocalSSOTokenSessionModule(AuthnRequestUtils requestUtils, SSOTokenFactory factory,
            AuthUtilsWrapper authUtilsWrapper); @Override void initialize(MessagePolicy requestPolicy, MessagePolicy responsePolicy, CallbackHandler handler,
            Map options); @Override Class[] getSupportedMessageTypes(); @Override AuthStatus validateRequest(final MessageInfo messageInfo, final Subject clientSubject,
            Subject serviceSubject); @Override AuthStatus secureResponse(MessageInfo messageInfo, Subject serviceSubject); @Override void cleanSubject(MessageInfo messageInfo, Subject subject); AuthnRequestUtils getRequestUtils(); SSOTokenFactory getFactory(); }
LocalSSOTokenSessionModule implements ServerAuthModule { @Override public AuthStatus validateRequest(final MessageInfo messageInfo, final Subject clientSubject, Subject serviceSubject) throws AuthException { if (!isInitialised()) { initDependencies(); } final HttpServletRequest request = (HttpServletRequest) messageInfo.getRequestMessage(); String requester = request.getParameter(REQUESTER_URL_PARAM); if (requester != null) { try { SSOToken requesterToken = getFactory().getTokenFromId(requester); if (getFactory().isTokenValid(requesterToken)) { Object o = RestrictedTokenContext.doUsing(requesterToken, new RestrictedTokenAction() { public Object run() throws Exception { return validate(request, messageInfo, clientSubject); } }); return (AuthStatus) o; } } catch (Exception ex) { throw new AuthException("An error occurred whilst trying to use restricted token."); } } return validate(request, messageInfo, clientSubject); } LocalSSOTokenSessionModule();  LocalSSOTokenSessionModule(AuthnRequestUtils requestUtils, SSOTokenFactory factory,
            AuthUtilsWrapper authUtilsWrapper); @Override void initialize(MessagePolicy requestPolicy, MessagePolicy responsePolicy, CallbackHandler handler,
            Map options); @Override Class[] getSupportedMessageTypes(); @Override AuthStatus validateRequest(final MessageInfo messageInfo, final Subject clientSubject,
            Subject serviceSubject); @Override AuthStatus secureResponse(MessageInfo messageInfo, Subject serviceSubject); @Override void cleanSubject(MessageInfo messageInfo, Subject subject); AuthnRequestUtils getRequestUtils(); SSOTokenFactory getFactory();  }