single-page-application,claims-based-identity,azure-active-directory,adal,office365-apps , Skip “” and redirect to federated ADFS

Skip “” and redirect to federated ADFS


Tag: single-page-application,claims-based-identity,azure-active-directory,adal,office365-apps

Any suggestion on how to skip the selection of login url (home realm?)


In OAuth2 and OpenId Connect you do so by passing the target domain in the “domain_hint” parameter. In ADAL you can pass it via the following:

AuthenticationResult ar =
                    new Uri("http://any"), PromptBehavior.Always, 
                    UserIdentifier.AnyUser, "");

In the OWIN middleware for OpenId Connect you can do the same in the RedirectToIdentityProvider notification:

    new OpenIdConnectAuthenticationOptions
        ClientId = clientId,
        Authority = authority,
        PostLogoutRedirectUri = postLogoutRedirectUri,
        Notifications = new OpenIdConnectAuthenticationNotifications()
            RedirectToIdentityProvider = (context) => 
                context.ProtocolMessage.DomainHint = ""; 
                return Task.FromResult(0); 

Finally, in WS-Fed you do the following:

   new WsFederationAuthenticationOptions
      Notifications = new WsFederationAuthenticationNotifications
         RedirectToIdentityProvider = (context) =>
            context.ProtocolMessage.Whr = "";
            return Task.FromResult(0);

So, if your are using ADAL js, just add to your ADAL init:

extraQueryParameter: '' 


Can I check for the existence of an HTTP only cookie with Javascript? [duplicate]

This question already has an answer here: Check if httponly cookie exists in Javascript 1 answer Can I use Javascript to see if an HTTP-only cookie exists, I don't want to see the value, just know whether or not it is there. I need this because I have an...

Show vertical and horizontal navbar once logged in

I was wondering if there was a way I could show a vertical and horizontal navbar once the user has been authenticated. I have this code working for the horizontal navbar: <div class="navbar navbar-inverse navbar-fixed-top" role="navigation" data-ng-controller="indexController"> <div class="container"> <div class="navbar-header"> <a class="navbar-brand"> <img src="/images/AltheaLogo.png" alt="AltheaDx" style="margin-top: -13px; background-color: #E0E0E0...

Add custom claims to ASP.NET MVC with organizational account (multiple tenants),azure,claims-based-identity,azure-active-directory
Is there a way to add custom claim to my ClaimsPrincipal once the user is authenticated? When using ASP.NET identity for individual accounts, one could add custom claims to the ClaimsPrincipal when the principal was created but I can not find the way to do this when using the Organizational...

react server side rendering with client side routing

An initial server rendering for my homepage route ( / ) works fine. Also, subsequent client side navigation to ( /#/page2 ) works fine. However, if I load /#/page2 directly from the address bar, the server rendered homepage loads in the browser first and then visibly transitions to /#/page2, which...

fullPage.js: Make all slides and sections visible in search engine results

I'm using fullpage.js jQuery plugin for a Single page application. I'm using mostly default settings and the plugin works like a charm. When I got to the SEO though I couldn't properly make Google crawl my website on a "per slide" basis. All my slides are loaded at the page...

Multiple Iterations from One Response

I want to show a list of product with details and a list of product's models which is checked at detailed list but I want to do it with only one get request. I mean I will get the json of products and I will use multiple times in page....

Skip “” and redirect to federated ADFS

Any suggestion on how to skip the selection of login url (home realm?)

AngularJS Tabs don't display HTML Files

In my SPA application, I have a view which I need to display tabs. I have the tabs showing up correctly and able to select each but for some reason the html associated with the tabs is not being displayed. They are in the same folder as the calling html...

back button behavior in angular js application

I have an issue with a SPA app written in angularJS. The application consist of thre views - login view, main view and log out view. myapp/#/login myapp/#/main myapp/#/logout my route provider: function Router($routeProvider) { $routeProvider .when('/login', { templateUrl: 'app/components/login/login.tmpl.html', controller: 'login.ctrl', controllerAs: 'vm' }) .when('/main', { templateUrl: 'app/components/dashboard/main.tmpl.html', controller:...

Is there a way to load JS and CSS only when necessary?

We are rewriting a very large legacy Webforms .NET application. Ideally, I would like to have it completely as SPA, based on AngularJS, Bootstrap, and WebAPI. Obviously, the overall look and feel should be consistent across the application. I have one big concern, however. There are many "rich" controls (calendar,...

MVC 5 OWIN login with claims and AntiforgeryToken. Do I miss a ClaimsIdentity provider?,,razor,,claims-based-identity
I'm trying to learn Claims for MVC 5 OWIN login. I try'ed to keep it as simple as possible. I started with the MVC template and inserted my claims code (see below). I get an error when I use the @Html.AntiForgeryToken() helper in the View. Error: A claim of type...

Backbone.Collection.reset() => child view is out of sync with parent

I have a list of items. They are stored in backbone pageable collection. They are displayed like this |---item1---------------------------| |---item2---------------------------| |---item3---------------------------| |---item4---------------------------| |---item5---------------------------| |---item6---------------------------| |---item7---------------------------| << 1,2,3...end >> User can click on individual item to open detail view in a separate page. Detail view has listeners initialized when it's created....

Angular SPA databinding

My angular SPA databinding is not updating automatically. Hoping you can tell me why. - This is my JS file: var app = angular.module('SDMApp', ['ngRoute']); app.config(function ($routeProvider) { $routeProvider .when('/para', { templateUrl: 'view/ParaView.html', controller: 'MainController' }); }); app.controller('MainController', function($scope) { $scope.CurrentlyShowing = "Hello"; }); And my html file: <!DOCTYPE html>...

AngularJs SPA with master/detail views: a “slow” approach

My app is a simple AngularJS SPA, which is essentially a contacts manager: the master (landing) page is a list of persons, one per row, in a ng-repeat loop. Each person, clicked, shows the details page: a form with many fields. Currently my router is like this app.config(function ($routeProvider) {...

Loading the specific page on Browser Refresh. SPA AngularJS

I am creating a new Web API and Angular application. I want to know how we can handle routes on server side. Everything is working fine. I am using ui-router for routing, when i refresh browser that its giving me. HTTP Error 404.0 - Not Found I want to know...

AngularJS - Is it Possible to load two different html with two different routers(one for each .html) in one single application?

I'm having two HTML files -> index.html and start.html So far I was developing an app(a small application) in a single dimensional thought where index.html serves as the main page and app-route serves as the main router for the application. Now we're creating a bigger application like a .com site...

Rails + AngularJS + (local server) setup not rendering pages

I am trying to setup server locally. I am Rails + AngularJs app. Already pulled prerender repo and started the server with node. $ export PORT=3001 $ node server.js 2015-03-13T08:15:48.152Z starting worker thread #0 2015-03-13T08:15:48.159Z starting worker thread #1 2015-03-13T08:15:48.161Z starting worker thread #2 2015-03-13T08:15:48.163Z starting worker thread #3...

Can't figure why my function is not a function?

I am trying to build a simple single page web app and I am stuck. I am trying to use the module pattern : var spa = (function () { var initModule = function( $container ) { $container.html( '<h1 style="display:inline-block; margin: 25px;">' + 'hello world!' + '</h1>' ); }; return...

Can we provide two entry points for single page application?

I am working on a Single Page Application. Our first page is login page where we enter username and password. Now client gave us a new requirement to provide a seperate login page for admin users. There should be an extra drop down list in Admin Login page. They need...

How to intercept web url from chrome and add headers to the request?

given: my chrome browser hits the following url that renders a single page application web view (index.jsp). url: http://server/dostuff?stuff=123 however, what I want to do is somehow intercept that GET request and tack on a header to it (i.e. X-HIDE-MAIN-FOOTER). if this header is present the code simply hides the...

How to filter records using group functionality in BreezeJs

I'm developing a client app that uses breezejs and Entity Framework 6 on the back end. I've got a statement like this: var country = 'Mexico'; var customers = EntityQuery.from('customers') .where('country', '==', country) .expand('order') I want to use There may be hundreds of orders that each customer has made. For...

SEO with single page application

I built a node.js social networking web site for noders but I get some serious problems to improve my SEO factors. How can I make it SEO friendly? And yes, given that it is a single page app, it is a little harder!

How to implement deep linking client on top of HATEOAS server?

There's a similar question on SO, but it's not phrased well and it lacks details. So I'm trying to write a better question. I'm interested in how to implement HATEOAS with a single page application (SPA) that is using pushState. I want to preserve deep linking so that users...

Save json to file in angularjs..? [closed]

I am new to angularjs and trying create an single page application. I have a home controller with very simple code. It has one button "Get Data" which calls the api and api returns a json data. Now I got the response and I can display the response on html...

RedirectToAction in a single-page application

I have a fairly simple single-page application that uses AJAX to load and replace contents of the page. The application should allow user to add phone numbers to a customer. After user loads a view to add a new phone number by clicking on Ajax.ActionLink on customers page he can...

Read authentication info (Principal) by developing a .Net Web Service

I am dealing with a Claim-based application, with the aim to display users info after their authentication through SSO. For a given authenticated user, I realized a .Net Web Page wherein I show all claims starting from the provided Principal (Page.User), as follows: public partial class ClaimsPage : System.Web.UI.Page {...

Share Authentication between MVC applications through WIF

I have two website i.e. A and B, where A and B both have their user store separately. If user is authenticated user of A, it should be able to access all authorized pages of B and visa versa. Can someone help me how i can do this using Windows...

Is it possible to access the properties of ApplicationUser in MVC without query?

I'm creating an ASP.NET MVC 5 app, and I'm using the default individual authentication, which in turn uses ASP.NET Identity. I extended the default ApplicationUser class by adding the following properties: public class ApplicationUser : IdentityUser { public string FirstName { get; set; } public string LastName { get; set;...

AngularJS directive not calling function on parent scope

I have a directive that includes an image with a right mouse click event that shows a custom context menu. When the user clicks on an item in this context menu, I want to call a method on the parent controller. I have set up the context menu using Ian...

ASP.NET Identity and Claim-based

How to use claims? For example, I want to set access to each page (resource) for each user. I understand, I can do it using roles, but as I understand, claim-based is more effectively. But when I try to create a claim, I see the following method: userIdentity.AddClaim(new Claim(ClaimTypes.Role, "test...

Why Single-Page Web Application [closed],html5,single-page-application
While Single-Page application approach is rising as a web development choice, I still don't understand, practically, how would losing the ability to go back/forward in the browser be an O.K sacrifice? Imagine Facebook without direct page navigation! Is there an essential/direct purpose for SPA I can't get my hands on?

How to bypass routing in Angular UI Router

I'm creating a web application in which the bulk of the functionality is deployed as an AngularJS single-page application, but there are also a few static content pages that are served in the traditional way. Navigation within the SPA employs Angular UI Router and seems to be working correctly, as...

Angular UI Router - Abstract Parent State with empty Url

Im trying to set up multiple nested states inside my app. This is the related code. function configFn($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise("/cart"); $stateProvider .state('checkout', { url: '/', templateUrl: 'app/checkout/views/checkout.container.html', controller: 'checkoutCntrl', abstract: true }) .state('checkout.cart', { data: { step: 1 }, url: '/cart', views: { "styles": { templateUrl: 'app/checkout/views/checkout.styles.html', controller: 'checkoutStylesCntrl'...

Why isn't a claim updated immediately in ASP.NET MVC?,claims-based-identity,
I'm using ASP.NET MVC 5, and ASP.NET Identity. I have extended the default ApplicationUser class like this: public class ApplicationUser : IdentityUser { public string Fullname { get; set; } public byte[] ImageData { get; set; } public string ImageMimeType { get; set; } public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager) {...

Authorization Model: Context of Role?

I am currently attempting to design an Authorization Model that has the following components: Privileges - an action that can either be granted or denied to a user/group Roles - a collection of privileges; roles can be associated with a user or group Security Objects - the entity to which...

Google analytics (via tag manager) loses track of adwords visitors after first pageload

I am experiencing a very strange problem with Google tag manager (GTM), Google analytics (GA) and Google adwords. So far I am getting nowhere with solving it. The setup: We have a singe page application (backbone and marionette) and we are using GTM to push virtual pageviews to GA using...

OAuth2 - Status 401 on OPTIONS request while retrieving TOKEN

Our stack uses Backbone as our client-side app and Spring Boot as a RESTful API. We're trying to make basic authentication using OAuth2 with user providing username and password. We use Spring Security for authentication and jQuery $.ajax method for making requests. However the response we get is 401(unauthorized) status...

Polymer single page application with lightbox

regarding to this question i have changed my polymer spa a little to load content dynamically. next thing is to add a lightbox gallery. i have found a very lightweigt version here as standalone it works very good but in my dynamic content page i am not able to get...

React with react-router: render component by replacing content in an element

In my app, I am using React.js as my javascript framework, in combination with react-router for navigation. I have a problem in replacing the content of my main container div. When I access some new route, the appropriate route handler is activated calling the render method, but that html is...

Visual Studio MVC and WebStorm working together and minimizing assets

I'm developing a SPA application in VS. I have separated html (angularjs) and webapi services. I develop html pages and css in WebStorm (which is perfect for the job) and VS for webapi (WebStorm and VS project folders are the same). Everything works fine but I want to minimize html...

How to UseCookieAuthentication OR ClaimsIdentity between ASP.NET Identity Owin site and ASP.NET WebAPI,,,claims-based-identity
I have an ASP.NET web application that is using ASP.NET Identity for login with UseCookieAuthentication in the Startup. The login site is working fine. I also have an ASP.NET WebAPI site that I use to gather data. I would like to secure the WebAPI with the same cookie that was...

what does $data and $root mean in the following context

I am following the tutorials at knockoutjs website. This is a code from that. view <ul class="folders" data-bind="foreach: folders"> <li data-bind="text: $data, css: { selected: $data == $root.chosenFolderId() }, click: $root.goToFolder"></li> </ul> viewmodel function WebmailViewModel() { // Data var self = this; self.folders = ['Inbox', 'Archive', 'Sent', 'Spam']; self.chosenFolderId =...

Angularjs resource with scope parameter

My problem is the following: I am trying to call resource with the following parameter and I get the following error: [$resource:badcfg] I tried fixing this in the past 3 hours and I cant seem to make it work. So, if i call it like this: $scope.komintent = Fakturi.komintenti.get({ id:...

Load JSON into Angular

I am new with Angular.js. I try to get json from my local url JSON content is: [ { "fullsizeurl": "/uploads/incubout_denemeshop/1/product/3-kdd4eesv-erer-1-cent-1.png", "productid": "3", "price": "0.01", "isactive": 1, "brandid": "1", "subcategoryid": "1", "model": "1 Cent", "isbundle": 0, "subcategory": "Cat2", "taxincluded": 0, "brand": "erer", "thumbnailsizeurl": "/uploads/incubout_denemeshop/1/product/3-kdd4eesv-erer-1-cent-1_thumb.png" }, { "productid": "1", "isactive":...

Why isn't my Azure Website accepting OAuth tokens?

I want my application to accept OAuth tokens when hosted using Azure Websites. I have the following: web.config of web app <appSettings> <add key="ida:Realm" value="" /> <add key="ida:AudienceUri" value="" /> <add key="ida:Tenant" value="" /> </appSettings> Startup.cs of web app using System; using System.Collections.Generic; using System.Linq; using System.Web; using Microsoft.AspNet.SignalR; using...

Retrieve information from Bearer Token,claims-based-identity,claims,bearer-token
I have an MVC website that is calling a WebAPI in another project. The WebAPI uses OWIN and implements OAuth security. I will be using a Bearer Token to communicate between the MVC and WebAPI applications. My website requires the user to be in AD, which I am checking in...

Can't access element in the same view using AngularJS

so in general I want to build a single page application with AngularJS and I want my page to have different content for public and registered users, thus I put my navbar, content and footer part into different views. The structure looks like this: index.html script.js navbar.html content.html footer.html uirouter.html...

How to create a custom identity provider with SQL Server? [closed]

The scenario I have is the following, I am going to create a software as a service application hosted in azure, where all users will be able to login with a username and password, the SQL identity provider seems a good option but I need something custom. The software would...

Passing Authentication from WebApp to WebAPI using BreezeJS

I am having two web applications, one a SPA using AngularJS + BreezeJS and the other a WebAPI. We are building authorization in the WebAPI and the results get filtered based on user access. We want the user to sign-in into organization Azure AD in the SPA and pass the...