Coder Social home page Coder Social logo

unl_cas's People

Contributors

ericras avatar macburgee1 avatar mfairchild365 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

unl_cas's Issues

Refactor to use drupal cache and phpCAS client

Loading in the old zend components is going to cause problems. We should be used recommended and supported clients.

Specifically with php 7:

Deprecated function: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in Zend_Validate_Hostname->isValid() (line 549 of modules/unl_cas/libraries/Zend/Validate/Hostname.php).

Zend_Validate_Hostname->isValid('login.unl.edu') (Line: 445)
Zend_Uri_Http->validateHost() (Line: 277)
Zend_Uri_Http->valid() (Line: 154)
Zend_Uri_Http->__construct('https', '//login.unl.edu/cas/serviceValidate?service=http%3A%2F%2Flocalhost%2Fworkspace%2FUNL-CMS-2%2Fuser%2Fcas%3Fdestination%3Dwebform%2Fexample&ticket=ST-17368-1Uf7L70F3cs7UwoefJD2-its-idm-sso') (Line: 143)
Zend_Uri::factory(Array) (Line: 305)
Zend_Http_Client->setUri('https://login.unl.edu/cas/serviceValidate?service=http%3A%2F%2Flocalhost%2Fworkspace%2FUNL-CMS-2%2Fuser%2Fcas%3Fdestination%3Dwebform%2Fexample&ticket=ST-17368-1Uf7L70F3cs7UwoefJD2-its-idm-sso') (Line: 283)
Zend_Http_Client->__construct('https://login.unl.edu/cas/serviceValidate?service=http%3A%2F%2Flocalhost%2Fworkspace%2FUNL-CMS-2%2Fuser%2Fcas%3Fdestination%3Dwebform%2Fexample&ticket=ST-17368-1Uf7L70F3cs7UwoefJD2-its-idm-sso') (Line: 289)
Unl_Cas->validateTicket() (Line: 70)
Drupal\unl_cas\Controller\UnlCasController->validate()
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

redirect to CAS based on unl_sso cookie is being cached by drupal

This is causing everyone to hit CAS by default and preventing crawling by things like Web Audit.

To replicate this issue locally:

  1. run drush cr to rebuild the cache
  2. run curl --cookie "unl_sso=yes" http://your-url/ to simulate a request with the unl_sso cookie
  3. run curl http://your-url/ and you should see a small page indicating that it is a redirect to CAS (not what an anonymous user should see)

I think this is because of the default cache-contexts which ignores cookies. However, I cant figure out how to include the cookies:unl_sso key to the cache context. Any thoughts @ericras?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.