Log In doesn't work after Abp .net core web app deployed to server - asp.net-core

I use Abp.io framework and build .net core razor application including api.
It work perfectly on my localhost, but after I deploy to smarterasp.net, the login doesn't work anymore.
My URL is ,for example http://mybackendportal-001-site1.btempurl.com/.
I already change the appsetting of App:SelfUrl and AuthServer:Authority to above URL.
But still doesn't work, after login, it's redirect to login page again even the user name is password are correct, and no console error.
How can I fix this issue?

I fixed this issue by using this reference (How to fix the Chrome login issue for the IdentityServer4).

Related

.NET Core 5.0 error 400 after redirected to login page from Quickbooks OAuth, issue resolves if i revisit the Url by pressing enter

I have a .NET Core 5.0 application which authenticates & integrates Quickbooks with OAuth and then redirects to the application login page. When I click login, I get an http 400 error and cookie for ASP.NET Core Identity is not created, yet but if select the url and press enter then it just works fine, anybody has any suggestions on this?
I tried a couple of things like adding authorize in that controller form where I am redirecting and also tried several cookie settings I found but nothing worked so far

Redirect Uri is not working in react native for msal

I have a react-native app in which I am trying to move to msal from adal using the react-native-app-auth library in which finally after authentication I am getting this window that "Only continue if you downloaded the app from a store or website you trust", as clicking any button does not work, I found one issue related (Desktop app + Microsoft Authentication Error) but there is also no solution provided there too and I have tried with the HTTP:// URLs too.
So, did any one of you faced the same issue, so please help in the resolution. The final window I am getting
According to your follow-up comment I notice that you are facing redirect URL issue. In Redirect URI, select Web and type /.auth/login/aad/callback.
For example:https://contoso.azurewebsites.net/.auth/login/aad/callback.
Follow these steps and ensure all steps are followed.
https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-provider-aad#-create-an-app-registration-in-azure-ad-for-your-app-service-app
Enable Azure active directory in you App Service app.
https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-provider-aad#-enable-azure-active-directory-in-your-app-service-app

React SPA app with .net core backend and .net identity

I basically have the same question as what is detailed here: Login redirect with asp.Core 2.0 and React. But that post never got an answer.
I've searched quite a bit and pretty much my problem is also touched on here here: https://github.com/aspnet/JavaScriptServices/issues/1440
I want to create a react front end application, but use .net core for the backend. I've used the .net core template with react redux as my boilerplate. I've also configured the .net identity on my backend. So I can actually use [Authorize] on my api calls and it works. By this I mean that if someone is authenticated the api returns data and if no one is authenticated it returns whatever the default redirect page is. I can confirm this by looking at the response on my chrome debugger and I see that it is showing the html for the register page which I've defaulted my login path to in configureapplicationcookie options.
The boiler plate is setup to serve up pages from the react client folder and uses react router. Therefore, I cannot set up any links to pages on my server. However, I'm able to manually navigate to my server pages for example /Account/Login and successfully login. My api calls through the links on the react front end then seem to work just as I would like.
What I would like to do is:
make calls from my react application to my server api
upon unsuccessful access to any api endpoint, redirect the user/request to my register page on the .net core server
have the user register and/or login and then redirect them to the route they came from through the react application.
Is this possible? Is it advisable?
I understand that you can manage all this on the front end using IdentityServer as detailed here: http://docs.identityserver.io/en/release/quickstarts/7_javascript_client.html. However, if all the infrastructure can be quickly spun up in .net and I can leverage the authentication templates, then I want to experiment with that setup and save time. Plus if this is feasible, why bother doing the setup on the front end using a 3rd party login provider? What am I missing?

DotNetOpenAuth redirection URL results to page not found

I have deployed a service using DotNetOpenAuth library.
The service authenticates against 4 providers (Google, Yahoo, Windows and Facebook)
I am having a problem with Windows and Facebook (Oauth protocol)
My services works fine when accessed through any browser. It redirects to the correct provider after selection, authenticates and replies back with the email address.
But the service does not work when accessed through a Mobile device. Using mobile, when I select Windows/Facebook, it redirects me to the login page. After providing my credentials, the service returns but the redirection of the url leads to page not found.
The url that is redirected seems like: http://mydomain.com/facebook.aspx?code=a_very_long_string
I get a message that page not found on the browser of the Android phone. The same code works fine when accessed through the browser of a desktop/laptop (Windows 7).
Please let me know if I am missing anything to make the service work for the mobile phone
I am able to resolve this issue. It turns out I cannot use server.Urlencode() .Net function before doing a custom redirection.
If I use it, the app breaks in the mobile platform. Removing it, fixed the issue and the url is successfully redirected.
I was doing a custom redirection after the authentication is successful and encoding the url. But seems that it breaks the application.
Not sure if it is a limitation in DotNetOpenAuth library or it is a limitation of the mobile browser.

How do I register a controller that has been created in an AREA

I am using MVC4's WEB API to expose a controller.
Initially I created created a MVC4 WEBAPI project, set the project not to open any web page, wait for an external app to call the URL (WEB API). The project in VS2010 is set to run from IIS7 Express, not VS2010's Dev Server. This works OK, the browser prompts me to down load a file. Which is OK for me, as the browser does not know what to do with the returned data (RAW TEXT).
Next, I created an AREA in the MVC4 project area, then added a controller (WEB API type).
Then I once again ran the project and in a browser entered the the URL (WEB API). And it fails.
Ed.
The DefaultHttpControllerFactory doesn't work with Areas by default. To get this functionality you have to write your custom HttpControllerFactory.
You can find how to do this at the post How to create HttpControllerFactory to support Areas
While it is possible to place WebApi Controllers in different Areas, ASP.NET MVC 4 RC will still treat these ApiControllers as if they all reside in the same namespace. This is a limitation of the DefaultHttpControllerSelector, which is responsible for selecting the appropriate ApiController.
Fortunately, you can inject your own implementation of this class. In fact, I've already encountered this very issue and written an "area aware" HttpControllerSelector. You can find a blog post of mine about this issue and its solution here:
http://blogs.infosupport.com/asp-net-mvc-4-rc-getting-webapi-and-areas-to-play-nicely/