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


Skip “login.windows.net” and redirect to federated ADFS

Question:

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?)


Answer:

http://www.cloudidentity.com/blog/2014/11/17/skipping-the-home-realm-discovery-page-in-azure-ad/

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 =
    ac.AcquireToken("https://developertenant.onmicrosoft.com/WebUXplusAPI",
                    "71aefb3b-9218-4dea-91f2-8b23ce93f387",
                    new Uri("http://any"), PromptBehavior.Always, 
                    UserIdentifier.AnyUser, "domain_hint=mydomain.com");

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

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

Finally, in WS-Fed you do the following:

app.UseWsFederationAuthentication(
   new WsFederationAuthenticationOptions
   {
      Notifications = new WsFederationAuthenticationNotifications
      {
         RedirectToIdentityProvider = (context) =>
         {
            context.ProtocolMessage.Whr = "mydomain.com";
            return Task.FromResult(0);
         }
      }
   }
}

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

extraQueryParameter: 'domain_hint=yourCompany.com' 

Related:


Angular UI Router - Abstract Parent State with empty Url


javascript,angularjs,angular-ui-router,single-page-application
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'...

Add custom claims to ASP.NET MVC with organizational account (multiple tenants)


asp.net-mvc,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...

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


single-page-application,pushstate,hateoas
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]


json,angularjs,single-page-application
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...

How to UseCookieAuthentication OR ClaimsIdentity between ASP.NET Identity Owin site and ASP.NET WebAPI


asp.net,asp.net-web-api,asp.net-identity,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...

Can we provide two entry points for single page application?


jquery,backbone.js,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...

Why Single-Page Web Application [closed]


asp.net,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?

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


javascript,authentication,cookies,servicestack,single-page-application
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...

Why isn't my Azure Website accepting OAuth tokens?


azure,oauth,claims-based-identity,azure-active-directory
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="https://example.com/development" /> <add key="ida:AudienceUri" value="https://example.com/development" /> <add key="ida:Tenant" value="example.com" /> </appSettings> Startup.cs of web app using System; using System.Collections.Generic; using System.Linq; using System.Web; using Microsoft.AspNet.SignalR; using...

OAuth2 - Status 401 on OPTIONS request while retrieving TOKEN


spring-security,oauth-2.0,cors,single-page-application,restful-authentication
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...

ASP.NET Identity and Claim-based


c#,asp.net-mvc,asp.net-identity,claims-based-identity,claims
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...

AngularJS directive not calling function on parent scope


angularjs,angularjs-directive,angularjs-scope,single-page-application
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...

react server side rendering with client side routing


javascript,reactjs,single-page-application,isomorphic-javascript
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...

RedirectToAction in a single-page application


c#,asp.net,ajax,asp.net-mvc,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...

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


c#,asp.net,asp.net-mvc,claims-based-identity,claims
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;...

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


jquery,seo,web-crawler,single-page-application,fullpage.js
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...

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


angularjs,single-page-application,angularjs-routing
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...

How to bypass routing in Angular UI Router


angularjs,angular-ui-router,single-page-application
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...

Passing Authentication from WebApp to WebAPI using BreezeJS


odata,breeze,asp.net-web-api2,single-page-application,azure-active-directory
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...

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


javascript,jquery,single-page-application
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...

back button behavior in angular js application


javascript,angularjs,single-page-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:...

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


c#,asp.net,.net,asmx,claims-based-identity
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 {...

Visual Studio MVC and WebStorm working together and minimizing assets


angularjs,visual-studio-2013,single-page-application,minify,webstorm
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...

Angularjs resource with scope parameter


javascript,asp.net-mvc,angularjs,single-page-application
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:...

Show vertical and horizontal navbar once logged in


c#,angularjs,twitter-bootstrap,single-page-application
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...

Angular SPA databinding


angularjs,data-binding,single-page-application
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>...

Load JSON into Angular


javascript,json,angularjs,single-page-application
I am new with Angular.js. I try to get json from my local url http://85.96.243.31/admin.productss/searchwithjson. 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":...

Retrieve information from Bearer Token


asp.net-web-api,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...

Polymer single page application with lightbox


polymer,lightbox,single-page-application
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...

MVC 5 OWIN login with claims and AntiforgeryToken. Do I miss a ClaimsIdentity provider?


asp.net-mvc,asp.net-mvc-4,razor,asp.net-mvc-5,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...

AngularJS Tabs don't display HTML Files


angularjs,single-page-application
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...

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


java,jsp,rest,http,single-page-application
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...

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


javascript,angularjs,single-page-application
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) {...

Why isn't a claim updated immediately in ASP.NET MVC?


asp.net-mvc,claims-based-identity,asp.net-identity-2
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) {...

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


c#,asp.net,azure,asp.net-identity,claims-based-identity
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...

Skip “login.windows.net” and redirect to federated ADFS


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?)

Can't access element in the same view using AngularJS


angularjs,single-page-application,angularjs-ng-include,ng-view,multiple-views
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...

Multiple Iterations from One Response


javascript,json,angularjs,single-page-application
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....

Rails + AngularJS + Prerender.io (local server) setup not rendering pages


ruby-on-rails,angularjs,phantomjs,single-page-application,prerender
I am trying to setup Prerender.io 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...

How to filter records using group functionality in BreezeJs


entity-framework,breeze,single-page-application
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


node.js,seo,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!

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


reactjs,single-page-application,react-router
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...

Loading the specific page on Browser Refresh. SPA AngularJS


angularjs,asp.net-web-api,single-page-application
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...

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


backbone.js,google-analytics,single-page-application,google-adwords,google-tag-manager
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...

Authorization Model: Context of Role?


security,authorization,claims-based-identity,abac,role-based-access-control
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...

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


knockout.js,single-page-application
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 =...

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


backbone.js,single-page-application,backbone.paginator
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....

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


javascript,html,css,angularjs,single-page-application
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,...

Share Authentication between MVC applications through WIF


c#,asp.net,asp.net-mvc,wif,claims-based-identity
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...