ory / ory/mocksaml

Add SLO support

Open
#22 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
TypeScript
Stars
168
Forks
54
PR merge metrics
No merged PRs in 30d

Description

From dnoliver:

Found a bug? Please fill out the sections below. 👍

Issue Summary

A summary of the issue. This needs to be a clear detailed-rich summary.

Not sure if this is a bug!
I am trying to use https://mocksaml.com as a mock for my idp for single sign on and single log out.
I am using the metadata url to configure my saml library https://github.com/SAML-Toolkits/python3-saml
So because the https://mocksaml.com metadata file doesn't have an SLO item, my lib tells me that SLO is not supported by the idp (which make sense).
But I also found some PRs and issues resolved related to slo (https://github.com/boxyhq/jackson/pull/128, and https://github.com/boxyhq/saml20/issues/14), so wanted to check if this is something that should be supported but its just missed from the public metadata file.

Steps to Reproduce

Well, for me, this is how I implemented SLO with the library I referenced.
The last line of the snippet throws: onelogin.saml2.errors.OneLogin_Saml2_Error: The IdP does not support Single Log Out

    from onelogin.saml2.auth import OneLogin_Saml2_Auth
    from onelogin.saml2.idp_metadata_parser import OneLogin_Saml2_IdPMetadataParser

    def logout(self, request):
        """Initialize SAML logout"""
        req = self.__prepare_tornado_request(request)
        idp_data = OneLogin_Saml2_IdPMetadataParser.parse_remote(
            self.saml_idp_metadata, timeout=5
        )
        self.saml_settings["idp"] = idp_data["idp"]
        auth = OneLogin_Saml2_Auth(req, self.saml_settings)
        return auth.logout(name_id=None, session_index=None)

But also, a simple way to show this problem is just to go to https://mocksaml.com/api/saml/metadata, and check for the following missing properties:

<SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="<URL>"/>
<SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="<URL>"/>

Any other relevant information. For example, why do you consider this a bug and what did you expect to happen instead?

I consider this a bug because I couldn't find docs saying if mocksaml supports slo or not, but I could find prs and issues referencing the support for slo. Maybe a "this service doesn't support slo" would be nice if that is the expectation

Technical details
  • Browser version: You can use https://www.whatsmybrowser.org/ to find this out.: Chrome 120
  • Node.js version: N/A (not using this as a lib, I'm using the service)
  • Anything else that you think could be an issue.

Thanks for doing this! It has been super helpful to develop and test SAML integration so far!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the /api/saml/metadata endpoint and trace how the service generates its SAML IdP metadata. Review the linked SLO pull request and issue for existing context before deciding how SingleLogoutService entries should be represented. Done means the metadata clearly advertises supported SLO endpoints, or explicitly documents that SLO is unsupported.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.