Angular UI Redirects to API URL - asp.net

I am building an application using Asp.Net WebAPI and Angular.
We are implementing Windows Authentication on both the UI application and WebAPI.
While running the application in the browser the first time, the Windows Authentication popup is shown for. But instead of waiting until the user has authenticated, the application redirects to API url in browser.
Can anyone help me to solve the problem.
Thanks

Related

How to extend ASP.Net Web Forms app adding Blazor?

We have a large legacy web forms application.
We would like to continue to extend the functionality of it (add new pages). But we would like to stop adding more Web Forms code and instead would like to use Blazor to develop all new features going forward.
Ideally, a link from a Web Form page would redirect the browser to a page served by a Blazor app and vice-versa and the transition would be indistinguishable to the user.
Is this possible? If yes, how can it be done?
Also, what about authentication? Ideally, the user would login in our existing Web Form app and would not need to login again when transitioning to the Blazor app.
What I did:
Host the blazor application in a subfolder under the existing app:
myapp.com/oldapp
myapp.com/oldapp/blazor
You can just add links between them, If you use the same layout users should not notice.
Now because you are using the same hostname, you can issue a cookie with a JWT token on login in the old app, and because the new app runs on the same hostname the blazor app can pickup this cookie and use the token to do requests to a new backend API that is also using JWT auth.

How to use Asp.Net Web Api with window authentication?

I have a application on local network with window authentication. Application is working fine. There is a old version of application too that is running on the same network. New application will replace old one later on. But for time being i need service to be exposed for old application. What i did is i made an API in the same application where window authentication is being used. Now the problem is that i don't want any kind of authentication on Web API but i am unable to test it by any tool like postman and fiddler. When i hit the URI it shows 401 error. Even i have to give windows credentials in browser to test it. After window authentication in browser service is running fine but i want to without window authentication.
I have tried many things like i put [allowanonymous] attribute on controller level. I put location tag with anonymous users in web.config file but nothing is working for me.
Can anyone tell me is it possible to do this and how?

How to redirect to AngularJS app after login using ASP.Net Identity in MVC

I am working on a project where it involves the feature of Login/Authentication using ASP.Net Identity. I used SQL Server database successfully and used Role based authentication. However, after successful login, I want to redirect the user to AngularJS app's page.
For this, I have app folder in my project which consists app.js and other controller files to route.
I don't know how should I redirect to AngularJS app after users logins.
Any tips/comments would be really helpful.

SignalR Chat application not working with IIS

This is the url from where I've downloaded the SignalR chat application between a web server and a web client.
http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr
This works fine when debugged on VS2013 but when published and deployed on IIS 7, somehow doesn't work as expected. To be more clear, I'm getting page displayed properly, but the dialog box doesn't popup for entering the username(which it is supposed to behave like) and the page remain static, when the url is hit from a browser.
Is this a configuration issue with SignalR and IIS ? Kindly help in making it work. I'm new to SignalR, and am trying to make a sample SignalR app work in IIS.
Thanks in advance !
Check the Applicatlion pool it should be ASP.Net4.0 (integrated).

How to Synchronize Session / Security between ASP.NET and Tomcat?

I have an Asp.NET 3.5 application with security/authentication. I have a second application (built using GWT and running on Windows Tomcat) running on a different machine.
I need to make the second application available to the user via a link generated from the .NET application. This part is easy, I have constructed the link in the asp.net page and the user can click on it to start working in the GWT/Tomcat session.
My question is this...
How do I set it up so that the Tomcat/GWT application is Only Accessible via the link in my asp.NET application?
I don't want the user to be able to copy the link from my asp.net page and then share that with someone else who is not authenticated within my asp.net application.
Your tomcat application will be passed a cookie that is the .NET authentication token iff the client has logged in to your .net application.
Your tomcat application can get this cookie from the request headers, and compose another request with this cookie to check with your .net server and see if the cookie (token) is valid.

Resources