JavaScript redirect in web context of HTML & JS store app - windows-8

I'm having an issue with an which sits behind an enterprise authentication system. The app is an HTML5 web app which is loaded remotely through an iframe. This works fine, until the authentication system is integrated; this uses a javascript redirect which WinJS refuses to follow and logs an error APPHOST9624.
Is there a way around this?

Related

Google ClientID works for Google Sign-in platform library but not new GIS library

I'm trying to migrate my application from the older Google Sign-In platform library to the newer Google Identity Services library.
I have a client ID that works for the old method, but when I load the "Google Sign-in" button using GIS, I get 403 errors and an error log that GSI_Logger says my origin is not allowed for the client ID. I'm on localhost, but when I use the old method, there are no issues with localhost.
The only thing I can think of being different is that I load my Google client ID as a constant and rendered the button in the mounted() section of my Vue app's Login.vue, while previously I loaded it in main.js.
"Google One Tap can only be displayed in HTTPS domains".
So, it doesn't work because localhost is HTTP. I deployed to my testing environment which is HTTPS and got no such 403 errors.
Source: https://developers.google.com/identity/gsi/web/guides/get-google-api-clientid

Can React Js application be hosted on S3 bucket

I thought we can only host Static websites onto S3 bucket.
How can React Js apps be hosted onto S3? React pages are dynamic in my understanding. The content of the page changes based on the user choices made on the page. Isn't that correct?
thank you
React pages are dynamic in my understanding.
Your definition of "dynamic" and S3's definition of "dynamic" are not the same thing.
Everything that's changing in the React application is happening in the browser. It's just the browser running JavaScript code. Nothing on S3 prevents a browser from running JavaScript code.
What they mean is that you can't have dynamic server-side content, such as a Node.js application or a PHP application.
The React application is served to the user by static HTML/JavaScript/CSS files.
React is a Single-page application (SPA) with browser -side rendering. A Single-page application (SPA) is a web application implementation that loads a web document and updates it by using JavaScript APIs in the browser. In simple terms, when a web application written in react works, the browser download the application files and run it using JavaScript on browser with the support of react libraries. Therfore the content in react app (min.js files and other assests in a production build) are not changing with time. A static storage and a public access(url) is the sufficiant to host a react application. So it can be host in a S3 bucket or github-pages or similar static storage without any computing power.
In a react webapp what's dynamic is the rendering of HTML elements using javascript. A dynamic web application refered by AWS is a one with dynamic server side rendering as Node.js. You can refer this guide to learn more on how to deploy a React application in Amazon S3.

Planting an Iframe as Aura component to show an external system that receives information from Salesforce API using oAuth web server flow

I have built a web app for our sales team.
The web app is currently using oAuth web server flow in order to authenticate with Salesforce.
Everything is working fine when running it on a separate tab.
We recently wanted to add some functionality from within Salesforce specific objects and display information from our web app.
So I've built an aura component displaying an Iframe with the URL from our web app.
Unfortunately, it crashes with a console error
Refused to frame 'https://***.my.salesforce.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'none'".
So I went to Salesforce's login page and indeed, there is a policy header that prevents it from being loaded from within an Iframe.
What is the correct way to authenticate the user with Salesforce in this situation?
Thank you very much
If you are calling a web app inside of an Iframe(Aura component) it would require the Salesforce domain calling it to be whitelisted in the web app.

ADFS web authentication loop in IE

I have a mvc4 web app that sits behind ADFS 2.0 authentication, it's configured using the web.config file. The application can be visited by going directly to a URL or as an iframe inside of CRM 2013.
The application works in all (tested) browsers when visiting the URL directly, both redirection to login form and handing the user back to the web app with the proper information in the ClaimsIdentity.
However, when visiting the app as an iframe inside CRM2013, internet explorer goes into a continous login loop. You are asked to provide the credentials (which are the same as for logging in to CRM) and when you click ok you get redirected back to the same login page again, to my knowledge the app never receives the hand off.
In Safari, Chrome, Firefox, and Opera the users are able to log into the application inside of CRM as well as outside without any problems (I'd even go as far as saying that it works better than expected for these browsers).
Does anyone have any idea of what I can try or what the problem could be for IE?
EDIT 1
I'm thinking it has to do with some security setting and am playing around with the settings in IE. Unchecking this box stops the login form from showing in IE at all and I get an empty page instead.
Is the iFrame on the same (sub)domain as the site inside? You can use Fiddler to view your redirect flow, are the cookies added as expected?
I've seen cookies that are overridden by the iFrame host, in that case you lose the auth cookie. Browsers react differently on same domain cookies.
Another problem might be X-Frame-Options, do you see any warning in the F12 console of IE?

DotNetOpenAuth redirection URL results to page not found

I have deployed a service using DotNetOpenAuth library.
The service authenticates against 4 providers (Google, Yahoo, Windows and Facebook)
I am having a problem with Windows and Facebook (Oauth protocol)
My services works fine when accessed through any browser. It redirects to the correct provider after selection, authenticates and replies back with the email address.
But the service does not work when accessed through a Mobile device. Using mobile, when I select Windows/Facebook, it redirects me to the login page. After providing my credentials, the service returns but the redirection of the url leads to page not found.
The url that is redirected seems like: http://mydomain.com/facebook.aspx?code=a_very_long_string
I get a message that page not found on the browser of the Android phone. The same code works fine when accessed through the browser of a desktop/laptop (Windows 7).
Please let me know if I am missing anything to make the service work for the mobile phone
I am able to resolve this issue. It turns out I cannot use server.Urlencode() .Net function before doing a custom redirection.
If I use it, the app breaks in the mobile platform. Removing it, fixed the issue and the url is successfully redirected.
I was doing a custom redirection after the authentication is successful and encoding the url. But seems that it breaks the application.
Not sure if it is a limitation in DotNetOpenAuth library or it is a limitation of the mobile browser.