Skip to content

Commit

Permalink
Resolve comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joerger committed Nov 5, 2024
1 parent 21840be commit 903e6e6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -4564,10 +4564,10 @@ func (tc *TeleportClient) applyAuthSettings(authSettings webclient.Authenticatio
var ssoURL *url.URL
var err error
switch {
case authSettings.OIDC != nil:
ssoURL, err = url.Parse(authSettings.OIDC.IssuerURL)
case authSettings.SAML != nil:
ssoURL, err = url.Parse(authSettings.SAML.SSO)
case authSettings.OIDC != nil:
ssoURL, err = url.Parse(authSettings.OIDC.IssuerURL)
case authSettings.Github != nil:
ssoURL, err = url.Parse(authSettings.Github.EndpointURL)
}
Expand Down
5 changes: 4 additions & 1 deletion lib/web/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,10 @@ func samlSettings(connector types.SAMLConnector, cap types.AuthPreference) webcl
Name: connector.GetName(),
Display: connector.GetDisplay(),
SingleLogoutEnabled: connector.GetSingleLogoutURL() != "",
SSO: connector.GetSSO(),
// Note that we get the connector's primary SSO field, not the MFA SSO field.
// These two values are often unique, but should have the same host prefix
// (e.g. https://dev-813354.oktapreview.com) in reasonable, functional setups.
SSO: connector.GetSSO(),
},
// Local fallback / MFA.
SecondFactor: types.LegacySecondFactorFromSecondFactors(cap.GetSecondFactors()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,18 @@ export function manageRootClusterProxyHostAllowList({
}
}

// Allow the SSO hostname for SSO login/mfa redirects.
// Allow the SSO host for SSO login/mfa redirects.
if (rootCluster.ssoHost) {
allowList.add(rootCluster.ssoHost);
let browserSsoHost: string;
try {
browserSsoHost = proxyHostToBrowserProxyHost(rootCluster.ssoHost);
allowList.add(browserSsoHost);
} catch (error) {
logger.error(
'Ran into an error when converting sso host to browser sso host',
error
);
}
}
}
};
Expand Down

0 comments on commit 903e6e6

Please sign in to comment.