Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirecting to internal url after login instead of public origin #1064

Open
n-junge opened this issue Feb 6, 2019 · 1 comment
Open

Redirecting to internal url after login instead of public origin #1064

n-junge opened this issue Feb 6, 2019 · 1 comment

Comments

@n-junge
Copy link

n-junge commented Feb 6, 2019

I'm using the AspNetCore2 package for a service behind a reverse proxy.

My service authenticates successfully, but then it redirects from the /saml/acs to the internal URL instead of the as PublicOrigin defined url.

options.SPOptions.EntityId = new EntityId("https://service.company.com");
options.SPOptions.ReturnUrl = new Uri("https://service.company.com/?singlesignon=true");
options.SPOptions.PublicOrigin = new Uri("https://service.company.com");

options.SPOptions.ModulePath = "/saml";

options.IdentityProviders.Add(new IdentityProvider(new EntityId("..."), options.SPOptions)
{
	LoadMetadata = true,
	MetadataLocation = "...",
	SingleSignOnServiceUrl = new Uri(".."),
	Binding = Saml2BindingType.HttpPost,
});

For the above code, the service is running on "https://proxy:9999" and available via "https://service.company.com/subsite".

When visiting "https://service.company.com" I'm authenticated and then from "https://service.company.com/saml/acs" redirected to "https://proxy:9999/subsite" instead of "https://service.company.com/subsite".

JessieWadman pushed a commit to JessieWadman/Saml2 that referenced this issue Jun 3, 2019
@JessieWadman
Copy link

This issue also affects TLS terminating load balancers, where the redirect immediately after completing a sign-in will cause a https to http downgrade (for the same reason as you are getting the wrong host in the redirect).

@AndersAbel AndersAbel linked a pull request Apr 21, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants