Base solution for your next web application

Activities of "ribbo"

For anyone that comes across this thread and would like a workaround.

I had the same issue and needed to suppress the date timezone conversion for some of my dates. On the Angular side I remove the timezone offset before sending and when I get it back from the API for reading.

When you are sending the date to the API run this function on your property and it will remove the timezone offset yourDate.utcOffset(0, true);

When you get the date from the API this will keep it as the date sent without any offset applied yourDate.utc();

By doing this before sending and when you receive you will be saving and reading the dates as they are selected regardless of any timezone settings. Eg. great for Date of Birth which doesn't change based on Timezone settings.

It is not ideal because it requires you to remember to do this anywhere you send\receive this date and open to you forgetting. But it gets the job done while ABP implements the Suppression attribute.

Hope it helps someone, Matt

Thanks, I am ideally looking for using the MVC login via a WebView and collecting the access token from this or some kind of SSO to the app from it. The reason being the SSO is to solution called Strava and using .NET MVC it was easily plugged in. I have already done this with Angular (as social login is much harder with Angular application), I use the MVC application to login and then do a SSO to Angular (using the same method as you use for the public web page).

Any thoughts from the team would be greatly appreciated before I take on the project.

Thanks, Matt

I had a similar requirement for a 3rd party SSO that would only work via MVC. I got around this by using a separate subdomain for Login vs Angular Application. I used MVC application for login and then redirect over to Angular app with SSO token to login the user. Similar process that is being used between Public Website and Angular but in reverse. Wasn't hard to implement and works well.

Ideally I wish login still worked as it did before they moved to full Angular client side login, ie. MVC methods for login that worked tightly with the Angular app. .NET MVC has a LOT more pre-built SSO integrations out there.

Thanks, Matt

@bolenton, very interesting. Will be great to hear how you go with it!

Thanks, looks to have fixed the issues. Was only running 15.2 of Visual Studio

You are correct, my test I accidentally actually used StaticRoleNames.Host.Admin which has a capital. So my test was wrong.

But that does still highlight the fact that SQLite is acting differently to EF with SQL Server in terms of Case Sensitivity?

Which log file is it going into? This doesn't happen to me but at times I would like it. I will ask the same question in reverse, how can I turn this on?

Thanks, Matt

Hi, I have actually got this all working. Steps was to copy the MVC project into my Angular solution from the MVC\JQuery solution. This gives me all the login requirements and Single Sign On token generation. Then added to the Angular Web.Core project to TokenAuthController a SingleSignOnAuthenticate function. This is then essentially the same as the Public website SSO login mixed with the Authenticate function. The key I found was to get the Identity which I used var identity = (ClaimsIdentity)(await _principalFactory.CreateAsync(user)).Identity; In the Angular side I just pass the SSOToken etc. into this function for SSO login.

It then worked perfectly to login from MVC login through to Angular application.

The reason I needed to do this is because the Angular application uses a very different Javascript based login for Social sites like Facebook, part of the reason you have issues with Microsoft login. I needed to sign into a different site Strava using OAuth2 that also can't be done easily via javascript. But it is easy to implement via the MVC project (I already had that working). So now I use the MVC project for Just logging into Strava via OAuth 2 and then SSO into the Angular project.

It works nicely now.

Thanks, Matt

I suggest you provide some more details of your issue\errors. This works fine for me with the 4.1.4 upgrade.

Thanks, Matt

In the login button on the public website you will see in the URL a parameter "returnURL". This tells tells the MVC application where to redirect the user to once the automatic sign in is done in the MVC application. You will see by default this returnURL is set to be the public website URL, meaning the user is logged in and redirected back to the public website. Change the returnURL to be what ever URL in your MVC application that you want the user to end up in.

eg. /account/login?ss=true&returnUrl=http://localhost:4200/App

Thanks, Matt

Showing 1 to 10 of 25 entries