Skip to content
This repository has been archived by the owner on Oct 29, 2018. It is now read-only.

Not working with Auth0 SAML #614

Open
callahad opened this issue Mar 19, 2018 · 1 comment
Open

Not working with Auth0 SAML #614

callahad opened this issue Mar 19, 2018 · 1 comment

Comments

@callahad
Copy link

Follow-on to #44 and #185.

ScudCloud 1.65 opens the SAML authentication link in a new browser window instead of continuing in-app for Slack teams using Auth0.

Steps to reproduce

  1. Attempt to authenticate to mozilla.slack.com in ScudCloud
  2. Click "Sign in with Auth0"

Expected behavior

  1. Authentication continues in ScudCloud

Actual behavior

  1. Authentication opens in a new browser window, making it impossible to log in with ScudCloud

Root Cause

The SAML URL does not have a ?redir=... query parameter, so it fails to match SSO_URL_RE:

SSO_URL_RE = re.compile(r'^http[s]://[a-zA-Z0-9_\-]+.(enterprise.)?slack.com/sso/saml/start\?redir=.*')

Possible Solution

Shorten the regex to not examine the URL's query string:

diff --git a/scudcloud/resources.py b/scudcloud/resources.py
index eff107b..b946d31 100644
--- a/scudcloud/resources.py
+++ b/scudcloud/resources.py
@@ -8,7 +8,7 @@ class Resources:
     SIGNIN_URL = 'https://slack.com/signin'
     MAINPAGE_URL_RE = re.compile(r'^http[s]://[a-zA-Z0-9_\-]+.slack.com/?$')
     MESSAGES_URL_RE = re.compile(r'^http[s]://[a-zA-Z0-9_\-]+.slack.com/messages/.*')
-    SSO_URL_RE = re.compile(r'^http[s]://[a-zA-Z0-9_\-]+.(enterprise.)?slack.com/sso/saml/start\?redir=.*')
+    SSO_URL_RE = re.compile(r'^http[s]://[a-zA-Z0-9_\-]+.(enterprise.)?slack.com/sso/saml/start')
     SERVICES_URL_RE = re.compile(r'^http[s]://[a-zA-Z0-9_\-]+.(enterprise.)?slack.com/services/.*')
     GOOGLE_OAUTH2_URL_RE = re.compile(r'^https://accounts.google.com/o/oauth')

(Worked for me, at least)

@raelgc
Copy link
Owner

raelgc commented Mar 21, 2018

Hi @callahad and thanks for reporting this!

Do you mind to create a pull request with those changes?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants