Visitar URL original
Failed authentication results in unhandled exception at SP · Issue #2594 · simplesamlphp/simplesamlphp · GitHub
Skip to content

Failed authentication results in unhandled exception at SP #2594

Open

Description

@dnmvisser

When an IdP response to an SimpleSAMLphp SP does not contain a successful authentication, the SP will show an unhandled exception.

Although uncommon, it is a valid scenario.

Ideally the SP would handle this more graceful, with a user friendly message that describes better what is going on.

If the flow stops at the SP with an unhandled exception, the user will perceive this as a problem with the SP, while the real problem lies at the IdP.

Activity

  1. tvdijen commented on Feb 13, 2026

    @tvdijen
    Member

    I suggest we:

    1. Check the response status
    2. If not succes; convert it to an exception. There are exceptions available for each statuscode in the saml2-library. May need a factory-class for this to convert statuscode to exception. Throw it.
    3. In the exception handler, catch exception of type SimpleSAML\SAML2\Exception\ProtocolViolationException and treat it any way we want to.
  2. tvdijen commented on Feb 13, 2026

    @tvdijen
    Member

    We should keep in mind the errorURL-behaviour that has been recently added. It should not affect that

  3. thijskh commented on Feb 14, 2026

    @thijskh
    Member

    Some inspiration for the end user messaging might be what OpenConext currently does in this case:

    OpenConext Engineblock error message Identity Provider Error

    It tries to clearly indicate that you need to go to your own identity provider / institution to get this fixed.

    Improvement is probably to move status code and message more up, as in theory they should provide to most concrete context about the problem encountered (in practice the message is often empty nonetheless).

  4. monkeyiq commented on Mar 10, 2026

    @monkeyiq
    Contributor

    Digging into this a bit I see if I add a throw Error\Error('NOACCESS'); inside the SQL authsource then I see

    No access
    This endpoint is not enabled. Check the enable options in your configuration of SimpleSAMLphp.
    

    I was just looking for something to throw in the authsource.

    I am thinking here the outcome we are looking for is for that message to indicate that it has happened IdP side so the user might direct their efforts that the IdP rather than the tool they are trying to login with.

    This is also with my more local dev test env.

  5. tvdijen commented on Mar 10, 2026

    @tvdijen
    Member

    The NOACCESS-error is a SimpleSAML-error indicating that something is wrong in the SSP-application.
    What we are talking about in this thread are exceptions sent between IDP/SP in SAML 2.0 messages as defined in the SAML 2.0 core specifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions