Azure App Services - login to test page - azure

I'm trying to login to the App Services test page so I can open the help page but I can't seem to find the login credentials anywhere. Any idea how can I log in? I used Mobile Services before where I can find this pretty easily: https://blogs.msdn.microsoft.com/musings_on_alm_and_software_development_processes/2014/10/23/azure-mobile-services-prompts-you-for-a-username-and-password/ but this article seems outdated for App Services.

That is the default configuration Home page. There is the .UseDefaultConfiguration() method invoked in the Startup.MobileApp.cs. The part of that is the AddMobileAppHomeController() which depends on the corresponding Microsoft.Azure.Mobile.Server.Controllers.HomeController reference. You may want to remove that from the configuration and add the configuration and the view that you want to see (i am not sure that MobileAppHomeController page you see can be customized). Reference

Related

How to avoid running entire client-side process in Blazor WebAssembly before Azure AD authentication?

I'm building a Blazor WASM app with Azure AD, and I'm struggling with what appears to be an inefficiency in the way it's designed. The entire application, including the home page, needs to be secured by [Authorize]. It works (with one exception noted below), but the initial load is painfully slow. Basically, on reaching the home page, Blazor loads the entire application -- running Program.Main in it's entirety, loading JS files from CDN or webpack bundles, loading all the .NET dlls, and THEN decides that it needs to redirect to Azure to authenticate. Once it returns, it does all that again. Loading the various files is not too much of a problem, since it gets them from the browser cache the second time. The problem is that is also needs to run Program.Main again.
In my rather large client app, it takes a few seconds to configure all the services (I'm using a lot of gRPC). The biggest culprit though is a call to the server API to get certain app settings that I don't want to expose to the client (basically doing this). Moreover, that API call doesn't even succeed, since the API endpoint is secured, and the user hasn't authenticated yet, but I don't know how to get the user info from within Program.Main. The log messages show that the user identity is not even created until sometime after Program.Main completes. (One of the settings is the roles-to-permissions mapping, so I can't even draw the app's menu without it. I've resorted to removing the auth requirement from the API controller for now, obviously not a permanent fix)
To replicate the behavior, just create a brand new Blazor WebAssembly app, selecting Auth Type = Microsoft identity platform, and checking the ASP.NET Core hosted box. Then just edit both appsettings.json files to provide your Azure login info; change the requested scope in Client.Program.Main (and change the one in WeatherForecastController to match); and add [Authorize] to the _imports.razor file, and [AllowAnonymous] to Authentication.razor. Finally add some logging Console.WriteLine("Running in Client.Program.Main"); near the end of that method.
In the basic Blazor app template as described above, this all runs pretty fast. Once there's a significant amount of startup code in Program.Main, though, it becomes quite noticeable, it can be several seconds both before and after the login redirect. And I can't make an authenticated API call.
Specifying endpoints.MapFallbackToFile("index.html").RequireAuthorization(); in the server side Startup doesn't seem to make any difference. Neither does adding options.FallbackPolicy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); to the AddAuthorization call.
So basically, I'm looking to:
Identify the user in Client.Program.Main, so I can make a secure call to the settings API
Identify the user in Client.Program.Main, so I can bypass all the time-consuming stuff myself on the first pass
Get Blazor (server?) to somehow recognize that a request for a protected page will fail for an unauthenticated user, and go directly to the Azure login page without all the usual ceremony
Any suggestions?

Buildfire - Can I send users paths to the app outside of the app itself?

If I want a user fill out something within the app, can I give them a path that leads to the plugin within the app itself? For example when you try to open a google maps link on your phone and you have the google maps app it will just open the app.
If you are looking to deep-link into the app from outside your app, this is achieved through custom schema and a deep-link. So each app is issued a unique schema on the OS. You're used to schemas like "http" or "ftp" and so on. Custom schemas are registered on the OS to let then operating system know if they see this schema/protocol that your app is responsible for consuming it. For example, facebook is "fb://". You can contact customer support to see if your app has been issued one and what is it.
The second part of this is to deep-link to a particular plugin you can find a quick shortcut to it on the control side of your plugin in the Control Panel
.
Once you've gotten the app to open, then made it navigate to the plugin you want. The last step is optional but good to know. YOu can pass query-string parameters to the plugin so it may take further action from within. For example, you can have it prefill information or navigate to a subsection of the plugin.
Here is an example:
app683a5d://plugin/cb705192-fe4c-44e9-8032-34c9ee0a186a-1560793060569?firstName=Daniel&tel=555-555-5555
app683a5d:// Tells the OS which app to open
plugin/cb705192-fe4c-44e9-8032-34c9ee0a186a-1560793060569 tells the app which plugin instance to open
?firstName=Daniel&tel=555-555-5555 passes along data to the plugin to consume
Here are some helpful references:
Deep-Links https://github.com/BuildFire/sdk/wiki/Deep-Links
Navigation from within the app https://github.com/BuildFire/sdk/wiki/How-to-use-Navigation

How to test the front end performance of web page with a user token

I have a web application where the user needs to enter the user name and logging to the web page. I need to do a front end performance tests in the pages which loaded after user logging on to the web site.
After login to the web page, web page uses a user token to handle the uses session. Is there any tool/way to do front end performance test for this type of scenario.
I tried with the www.webpagetest.org but analysis stop from the login page it won't go to the page after the login page
You need to use protractor that helps you in this. For reference kindly go this page.
Basically, what it did for you, it runs tests against your application running in a real browser, interacting with it as a user would. It's an end-to-end test framework for Angular and AngularJS applications. Also able to perform testing on other framework too.
For more testing frameworks. kindly go here.

How to embed a web browser inside a web app made in node.js ?

I currently have a web app made in node.js. One feature of this app is to take notes. I want to provide the user with a way to browse the internet and select a text to add as a note in our web app without having to manually copy-pasting from one browser window to our app.
I know I can do this relatively simply using a Chrome extension that would be linked to the user account and would save the note to the database. However, I cannot use this approach since not all my users can install Google Chrome.
Therefore, I am looking for a way to browse the web from inside our web app. For example, it could be in an iFrame where we display a complete browser. That way, the user could navigate the web for information from inside the app, select text to save and click on a button (probably located outside the iFrame browser) to save the selected text as a note in our database.
How can I achieve such a thing in node.js ?
This is, essentially, impossible.
For you to get any data about the site the user was browsing you could either:
Restrict them to browsing sites willing to partner with you to give you permission to access their data via postMessage (a technical change on their part to work around the Same Origin Policy)
Proxy every request through your server which would:
Have large bandwidth requirements
Require a lot of rewriting of URLs (including dynamically generated ones in JS)
Require rewriting of X-Frames-Options and Access-Control-Allow-Origin headers
Need users who would trust you with all the data you passed through your system (including their passwords to third party sites)
Not work for Intranet sites (since your server could not reach them)

Unable to log in to Azure web app via VS2015 web performance test

How do I correctly handle the login/authentication scenario for an Azure web app in my VS2015 web performance test?
I created an XML file as a data source for the WAAD username and password. I bind the username and password to the Form Post Parameters: login and passwd respectively at request: https://login.microsoftonline.com/xxxx/login
But when I run the test, the Web Browser tab shows this error:
We can't sign you in
Your browser is currently set to block JavaScript. You need to allow
JavaScript to use this service.
To learn how to allow JavaScript or to find out whether your browser
supports JavaScript, check the online help in your web browser.
I also get a number of errors like this:
The value of the ExpectedResponseUrl property
Validation xxxx.azurewebsites.net/xxxx/docs/xxxx.aspx does
not equal the actual response URL
login.microsoftonline.com/xxxx/wsfed. QueryString
parameters were ignored.
Any idea how I can successfully log in to the Azure web app via the web performance test?
There are several methods of login and authentication that can be used. Just binding values to form post parameters may not be sufficient or correct. You will find the login form has hidden session identities that must be passed as well as the login data. I find that recording a test two times using as nearly as possible the same inputs and doing the same activities helps. These two tests can then be compared to find the dynamic data that needs to be handled.
In a comment the questioner added "I noticed these parameters, n1-43 are different but I have no idea what they represent. How do I handle them?". I can have no idea what they represent as I do not know the website you are testing. You could ask the website developers. Or, better, treat them as dynamic data. Find where the values come from, save them into context variables and use them as needed. This is basic web test development. Here and here are two good articles on what to do.
The message about JavaScript not being supported can be ignored. Visual Studio web tests do not support JavaScript or any other "active" parts of a web page, they only support the html part. Your job as a tester is to simulate what the JavaScript does for the specific user journeys you are testing. That simulation is generally just filling in the correct values (via context parameters) in the recorded requests.
Unexpected response urls can be due to earlier failures, such as teh login not working. I suggest not worrying about them until all of the other test problems are solved. Then, if you need help ask another new question.

Resources