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

Can't login or register (ERR_TOO_MANY_REDIRECTS) #4641

Closed
mhdcindioglu opened this issue May 1, 2020 · 10 comments
Closed

Can't login or register (ERR_TOO_MANY_REDIRECTS) #4641

mhdcindioglu opened this issue May 1, 2020 · 10 comments
Assignees
Labels
Milestone

Comments

@mhdcindioglu
Copy link

mhdcindioglu commented May 1, 2020

nopCommerce version: 4.3

Steps to reproduce the problem:

  • Download NopCommerce 4.3 with code.
  • UnZip code to HD
  • Run in VS Version 16.6.0 Preview 2.1
  • Install database in SQL Server V18.5
  • After NopCommerce started I can't login or Register
    Error Message: Redirected many times! ERR_TOO_MANY_REDIRECTS
  • I tried http and https.
@mhdcindioglu
Copy link
Author

I tried to remove this line:
[HttpsRequirement]
From:
Presentation/Nop.Web/Controllers/CustomerController line: 384

and it worked!

@mhdcindioglu mhdcindioglu changed the title I can't login or register I can't login or register (ERR_TOO_MANY_REDIRECTS) May 1, 2020
@Svmurvj
Copy link

Svmurvj commented May 1, 2020

I have same problem. What is best solution for that to handle on localhost ?

@SelectSystemsInternational
Copy link

I have it setup in both Visual Studio and on IIS and I could not login in either. When I ran the setup on IIS the default settings are not created for SSL (See Image 1).
StoreSetup1
I had to manually set the values then restart the webserver. Then I can login (See Image 2)
StoreSetup2
I also note the securitysettings.forcesslforallpages Setting is no longer used ?

@maplewang
Copy link

maplewang commented May 2, 2020

I am using Cloudflare SSL, you need add one line in web.config

<httpProtocol> <customHeaders> section to set Use_HTTP_X_FORWARDED_PROTO to true.

<add` key="Use_HTTP_X_FORWARDED_PROTO" value="true" />

check here https://www.nopcommerce.com/en/boards/topic/48285/err_too_many_redirects
or here https://www.nopcommerce.com/en/boards/topic/42111/cloudflare-flexible-ssl-and-nopcommerce-problem/page/2

`For those who are still struggling with Cloudflare Flexible SSL, this is how we solved the issue in nop 4.20:

  1. Set UseHttpXForwardedProto = true in Nop.Web/appsettings.json (Cloudflare setups X-Forwarded-Proto header to determine if request is secured. See more https://support.cloudflare.com/hc/en-us/articles/200170986-How-does-Cloudflare-handle-HTTP-Request-headers- ).
  2. Ensure "Always Use HTTPS" setting is enabled in Cloudflare.
  3. Ensure nopCommerce Store "URL" has https schema.
  4. Ensure nopCommerce Store "SSL Enabled" setting is set to true.
  5. Ensure nopCommerce "Force SSL for all pages" is enabled.
    `

@mhdcindioglu
Copy link
Author

mhdcindioglu commented May 3, 2020

The problem is here:
RedirectRequest(filterContext, _storeContext.CurrentStore.SslEnabled);
If we change this line to:
RedirectRequest(filterContext, !_storeContext.CurrentStore.SslEnabled);
It worked!

Nop.Web.Framework.Mvc.Filters.HttpsRequirementAttribute.HttpsRequirementFilter.OnAuthorization(AuthorizationFilterContext filterContext)

This value from where? _storeContext.CurrentStore.SslEnabled

SslEnabled is false so app redirect you to http with https port, but in VB localhost http port and https port is different.

@zerokewl88
Copy link

zerokewl88 commented May 3, 2020

I also had this problem, and was able to resolve this via updating the database and set the following:

Url -> https://[my site url]
Hosts -> [changed this to my site host]
SslEnabled -> 1

@mhdcindioglu
Copy link
Author

The question is: How the normal user can update the store data if he can't login.

@RomanovM RomanovM assigned skoshelev and unassigned RomanovM May 11, 2020
@AndreiMaz AndreiMaz changed the title I can't login or register (ERR_TOO_MANY_REDIRECTS) Can't login or register (ERR_TOO_MANY_REDIRECTS) May 12, 2020
skoshelev added a commit that referenced this issue May 12, 2020
@skoshelev
Copy link
Contributor

Closed #4641

@skoshelev
Copy link
Contributor

The question is: How the normal user can update the store data if he can't login.

Unfortunately, the only way to make corrections to the configuration when there is no access to the administration area is to directly edit the database.

@chu3kit0
Copy link

I have it setup in both Visual Studio and on IIS and I could not login in either. When I ran the setup on IIS the default settings are not created for SSL (See Image 1).
StoreSetup1
I had to manually set the values then restart the webserver. Then I can login (See Image 2)
StoreSetup2
I also note the securitysettings.forcesslforallpages Setting is no longer used ?

it worked for me

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

No branches or pull requests

9 participants