single-page-application

Recommended authentication UX in AngularJS SPA with own and external (Google, FB…) profiles

▼魔方 西西 提交于 2019-12-03 02:52:01
问题 I'm developing an Asp.net MVC + Web API + AngularJS SPA. I would like to have several types of registration/authentication: own profile provider external providers ie Google, FB etc. Possible scenarios As I'm having an SPA it would be best if I could keep my user on my page while external (or internal for that matter) would be taking place. I'd display a modal layer with particular content loaded (maybe even inside an iframe ). Can this be done? Online examples? Have login/registration

Remove authentication in ASP.net MVC single page application

我怕爱的太早我们不能终老 提交于 2019-12-03 02:11:38
I am trying to play about with the asp.net MVC SPA template in visual studio 2013, I don't need any of the authentication bits, I just need to load directly onto one of the controllers pages. How do I get rid of all the authentication stuff from the initial template? Castro Roy Remove the [Authorize] annotation from HomeController and remove this: @section Scripts{ @Scripts.Render("~/bundles/knockout") @Scripts.Render("~/bundles/app") } from Views\Home\Index.cshtml because one of does js is causing the redirect to the login page even after removing the [Authorize] annotation from

Authentication for users on a Single Page App?

随声附和 提交于 2019-12-03 01:19:55
问题 I have developed a single page app prototype that is using Backbone on the front end and going to consume from a thin RESTful API on the server for it's data. Coming from heavy server side application development (php and python), I have really enjoyed the new different design approach with a thick client side MVC but am confused on how best to restrict the app to authenticated users who log in. I prefer to have the app itself behind a login and would also like to implement other types of

Node js as http server and host angularJS SPA

独自空忆成欢 提交于 2019-12-02 22:58:33
I have an application written on angularJS and built by grunt. Is there a way I can create a http server from node js and host it there. Please share any code snippet or document which would help. Thanks (simplest) if you don't have any server side logic, you can simply serve client side AngularJS/HTML/css via http-server module from npm. https://www.npmjs.com/package/http-server Just install it via $>npm install -g http-server and go to your client folder, type http-server and hit enter. If you have server side code written, (ExpressJS or restify web api) then use $>nodemon server.js If you

OWIN send static file for multiple routes

為{幸葍}努か 提交于 2019-12-02 22:14:18
I'm making a SPA which sits on top of ASP.Net WebAPI. I'm waiting to use HTML5 history rather than #/ for history routing but that poses a problem for deep linking, I need to make sure / and /foo/bar all return the same HTML file (and my JS will render the right part of the SPA). How do I get OWIN/Katana to return the same HTML file for multiple different urls? To make things simple, while still keeping all the caching goodness etc. from the StaticFiles middleware, I'd just rewrite the request path using an inline middleware, like this public class Startup { public void Configuration

Nginx config for single page app with HTML5 App Cache

久未见 提交于 2019-12-02 20:52:47
I'm trying to build a single page app that utilizes HTML5 App Cache, which will cache a whole new version of the app for every distinct URL, thus I must redirect everyone to / and have my app route them afterward (this is the solution used on devdocs.io ). Here's my nginx config. I want all requests to send a file if it exists, redirect to my API at /auth and /api , and redirect all other requests to index.html. Why is the following configuration causing my browser to say that there is a redirect loop? If the user hits location block #2 and his route doesn't match a static file, he's sent to

How to avoid $compile:tpload errors on 401 status code response

こ雲淡風輕ζ 提交于 2019-12-02 20:47:41
We are developing a Single Page Application with AngularJS and ASP.NET MVC Json Rest API. When an unauthenticated client tries to navigate to a private route (Ex: /Foo/Home/Template ) to get a template, it gets a 401 response from the Web API and our AngularJS app automatically redirects it to the login page. We are handling the 401 with $http interceptor with something like this: if (response.status === 401) { $location.path(routeToLogin); return $q.reject(response); } Entering the correct credentials allows the client to get the template. Everything is working perfectly except for one detail

Knockout 'flickering' issue

天涯浪子 提交于 2019-12-02 20:13:08
I'm building a SPA (Single Page Application) using KO. the application looks like a book and the user can flip pages. The problem is that every time a page loads, there is a short moment where the page 'flickers' and the user sees the unstyled version of the page. I guess this is caused due to the fact that a lot of the styling is dependant on ko bindings so until ko finishes it 'magic' the user gets a glimpse of the unstyled code. Is it possible to tell when KO finished all its bindings and only then show the page? I've managed to partially solve it by setting a timeout before loading the

HTML snippets for AngularJS app that uses pushState?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 20:04:32
问题 I'm deciding whether it's safe to develop my client-facing app in AngularJS using pushState. I've read that when using pushState in an AngularJS app, we don't need to worry about Googlebot because it can now execute enough JS to produce an HTML snippet for itself. But then I wonder about Bing , Facebook and other bots and scrapers. The tutorials I've seen for making AngularJS SEO-friendly all deal with apps that use hashbangs (#!). These don't apply to me since I'm not using hashbangs. Does

Can one cache and secure a REST API with Cloudflare?

血红的双手。 提交于 2019-12-02 18:51:44
I am designing a RESTful API that is intended to be consumed by a single-page application and a native mobile app. Some calls of this API return public results that can be cached for a certain time. Moreover, there is a need for rate protection to protect the API against unauthorized users (spiders) Can I use Cloudflare to implement caching and rate-limiting / DDOS protection for my RESTful API? Caching: Cloudflare supports HTTP cache control headers so the API can decide for each entity requested via GET whether is public and how long it can be cached. However it is not clear whether the