Skip to content
Snippets Groups Projects
  1. Jul 13, 2016
  2. Jul 07, 2016
  3. Jul 06, 2016
    • Jaime Pérez Crespo's avatar
      Merge pull request #398 from ghalse/update-authwindowslive · 923ad7d5
      Jaime Pérez Crespo authored
      Update the authwindowslive:LiveID module to use OAuth 2.0 authorization
      923ad7d5
    • Guy Halse's avatar
      PSR-2 updates suggested by @jaimeperez · f7cdf2f0
      Guy Halse authored
      Improve the comment around error=user_denied
      f7cdf2f0
    • Guy Halse's avatar
      Update the authwindowslive:LiveID module to use OAuth 2.0 authorization · 059d7540
      Guy Halse authored
      rather than the discontinued OAuth WRAP. Attributes are now retrieved
      from the Microsoft Graph API rather than the Messenger API.
      059d7540
    • Jaime Pérez's avatar
      bugfix: Exception handler compatible with PHP 7. · b2bfd47d
      Jaime Pérez authored
      PHP 7 changed the way it handles internal errors. Now, Exception objects inherit from the Throwable interface, as well as the new Error objects. Internal functions throw Error objects now instead of raising an error, so the exception handler would need to handle them as well. Therefore, the exception handler is no longer guaranteed to receive an Exception object. We need now to discern whether the parameter is an exception (and continue our business as usual), or an Error (in case such thing exists, only PHP 7), and in this last case parse it and let the error handler do its stuff.
      
      This should resolve #330.
      b2bfd47d
    • Jaime Pérez's avatar
      bugfix: Make sure the PDO and Serialize metadata storage handlers return... · 1fa16596
      Jaime Pérez authored
      bugfix: Make sure the PDO and Serialize metadata storage handlers return metadata containing the 'entityid' key.
      
      While investigating issue #393, we noticed that these two handlers don't enforce the entity ID of each entity to be set in the 'entityid' key of the metadata array (the Flatfile and XML handlers to enforce this). Since this is the way we propagate the entity ID (code using metadata won't necessarily have access to the key of the metadata array containing the entity ID, or such a thing might not even exist), we need to make sure the entity ID is set inside the array. Otherwise, if the metadata for an entity does not contain it directly, the 'ExpectedIssuer' would be set to null, an error recorded, and authentication would fail as the entity ID of the IdP issuing an assertion would not match.
      1fa16596
  4. Jul 05, 2016
    • Jaime Pérez's avatar
      bugfix: Restore support for windows machines. · 93793d93
      Jaime Pérez authored
      Due to recent changes to fix the way we were building URLs (mixing what the 'baseurlpath' configuration option and the current URL, see #396), we introduced another bug by assuming file paths will always use slashes ('/'), which obviously is not true in Windows machines. This commit fixes SimpleSAML_Configuration::getBaseDir() and SimpleSAML\Utils\HTTP::getSelfURL() to take that into account.
      
      This closes #414.
      93793d93
  5. Jul 04, 2016
  6. Jul 03, 2016
  7. Jul 02, 2016
    • Jaime Pérez's avatar
      metadata: Add support for SHA2 digests when signing self metadata. · e86e40f4
      Jaime Pérez authored
      The hash algorithm to use to calculate signature digests for self metadata was not configurable. Add the 'metadata.sign.algorithm' configuration option to fix that.
      
      This resolves #411.
      e86e40f4
    • Jaime Pérez's avatar
      bugfix: Stop SimpleSAML_SessionHandler::newSessionId() from initializing the session. · 4056af12
      Jaime Pérez authored
      Historically, SimpleSAML_SessionHandler::newSessionId() has also created the session, sending the cookies to the browser. This is problematic both because given the name of the method one would not assume such behaviour, and also because even for transient sessions the handler would then try to set cookies. When we are using a transient session, it is likely to be because we cannot set cookies or because there was a temporary error when loading the session. If we try to set the cookies even for transient sessions, we could either get an error because cookies cannot be set, or overwrite the previous session cookies with transient ones, trashing a legitimate session in case a temporary error occurs.
      
      As a side effect, this can also cause behaviours like the one described in issue #413. There's no point in trying to set the cookies when it's not possible, so we shouldn't even try, and save us the errors.
      
      To fix this, we made SimpleSAML_SessionHandler::setCookie() abstract, forcing each extending class to implement it. The former implementation is moved to SimpleSAML_SessionHandlerCookie, and the SimpleSAML_SessionHandlerPHP gets a new method that starts the session, effectively sending the cookie. SimpleSAML_Session would then be responsible to call the setCookie() method of the session handler when creating a regular session, and skip it when creating a transient one. This introduces a bug, since SimpleSAML_Session was trying to set the auth token cookie calling the same setCookie() method in the session handler. We fixed that by using SimpleSAML\Utils\HTTP::setCookie() instead, in 8756835b.
      
      This resolves #413.
      4056af12
    • Jaime Pérez's avatar
      Remove superfluous code. · 5a1edb83
      Jaime Pérez authored
      If we just called isset() on SimpleSAML_Session::$instance, and it returned false as we continued execution, it makes no sense to get the "previous" instance since it will always be null. We can just check that $instance is not null later.
      5a1edb83
    • Jaime Pérez's avatar
    • Jaime Pérez's avatar
      Add an optional parameter to SimpleSAML_Session::useTransientSession(). · 067398e8
      Jaime Pérez authored
      This way we can pass an exception that made us use transient sessions, and get the method to throw that exception after getting the transient session.
      067398e8
    • Jaime Pérez's avatar
      SimpleSAML_Session should set the auth token using the... · 8756835b
      Jaime Pérez authored
      SimpleSAML_Session should set the auth token using the SimpleSAML\Utils\HTTP::setCookie(), instead of the setCookie() method provided by session handlers.
      
      The SimpleSAML_SessionHandler::setCookie() method should be used only to set the session cookie, not random cookies. If we want cookies to have the same parameters as session cookies, we can always get the session parameters calling SimpleSAML_SessionHandler::getSessionParams() and pass them to SimpleSAML\Utils\HTTP::setCookie().
      8756835b
    • Jaime Pérez's avatar
      Make the SimpleSAML\Utils\HTTP::setCookie() method throw the new... · ae8c4195
      Jaime Pérez authored
      Make the SimpleSAML\Utils\HTTP::setCookie() method throw the new SimpleSAML\Error\CannotSetCookie exception.
      ae8c4195
    • Jaime Pérez's avatar
      Typo: s/overriden/overridden/. · a0360b7d
      Jaime Pérez authored
      a0360b7d
    • Jaime Pérez's avatar
    • Jaime Pérez's avatar
      Silence errors when setting a cookie. · 6a6db6d3
      Jaime Pérez authored
      6a6db6d3
    • Jaime Pérez's avatar
      Fix indentation. · 271be82c
      Jaime Pérez authored
      271be82c
  8. Jul 01, 2016
  9. Jun 29, 2016
    • Jaime Pérez's avatar
      Add a new hook for exception handling. · 918dcd16
      Jaime Pérez authored
      In line with the previous commit, we now allow hooking in the exception handler, so that a module can implement its own logic to deal with certain exceptions.
      918dcd16
    • Jaime Pérez's avatar
      Stop intercepting exceptions in www/module.php. · 613e2c99
      Jaime Pérez authored
      The module.php file is the way we allow modules to have their own pages. All those are executed and presented to the user via this script. However, if an exception is thrown by a module, that exception will be captured directly by the module.php script. This prevents us from adding more logic to exception handling, adds code duplication, and makes the exception handling non-uniform, since we could end up handling the same exception differently depending on whether it was thrown by a module or by a regular page.
      
      Now we no longer intercept exceptions in module.php, allowing the exception handler to kick in. That way exceptions are always handled uniformly, and we can also implement additional logic that we may want (i.e. adding a hook to the exception handler so that modules could handle exceptions the way they want).
      613e2c99
  10. Jun 27, 2016
    • Jaime Pérez's avatar
      tests: Fix CI build. · 64142de9
      Jaime Pérez authored
      Now that we are using realpath() to try to obtain the URL relative to the base URL path of SSP, we need to use real scripts or realpath() will return an empty string.
      64142de9
    • Jaime Pérez's avatar
      bugfix: Resolve issue with incorrect self URL when using symlinks. · c72b6203
      Jaime Pérez authored
      Recent commits have introduced a new way to obtain the self URL, honouring whatever is specified in 'baseurlpath'. However, this new code breaks when accessing SimpleSAMLphp through a path containing symbolic links in the file system, since the base directory refers always to the real path while the $_SERVER contents reflect what the web server sees (symlinks included). We use realpath() to convert a path with symlinks to a canonical path that we can compare.
      c72b6203
Loading