Detect the Google Analytics Verifier Agent in C# - c#

I have an MVC 3.0 website, which redirects visitors to the home page based on their UserAgent.
At the moment I have a catch-all redirection for all non-specific browsers which forwards across to a different domain - The trouble is this has made my Google Analytics verification redundant and it now tells me the code is not installed because the page Google gets on visiting my site is incorrect.
Can anyone help me detect the Google Agent so I can return a simple page which confirms the presence of Google Analytics?
Thanks.

Just include the google analytics verification on every page.

Related

Could I sign into embedded PowerApp via Microsoft LiveID Account "quietly"?

I have a web app wrapper for my PowerApps app (I have embedded it as an iframe on the home page of my ASP.NET Core app).
I also have the credentials of the Azure organization that developed this application and has access to it.
So, for the first time, my built-in app asks for an email and password to sign in to a Microsoft account. And only after a successful login, I can work with it directly.
But that's not what I want.
I expect to be able to work with the application when I load this page.
So, is there a way to use the app directly without signing in to a Microsoft account?
I got the idea to make a request to the Azure AD API and get a bearer token or cookie from there, and then save it to the client, supposedly filling out a login form and clicking the login button, but "quietly".
To be honest, I don't know how I can do this. I've spent hours researching this problem, but haven't found a suitable solution.
Could you help me?
Thank you in advance!
Use ROPC flow, you just need to send a http request, then get the response.
There will be no pop-ups requiring you to log in.
Tips:
Http Request
Http Response
Related Posts:
Is there a way to improve the performance of MSAL-browser js login?

ASP.NET Webpage with link to Confluence Wiki using Windows login credentials

I've been tasked with seeing if we can give users of our internal web application help links to documentation pages on our company's Confluence Wiki. But here's the problem, the requirement is that users should not have to log into Confluence because otherwise they won't bother using the help links (which is understandable). Is there a way to forward a user to Confluence and log them in with their current windows AD credentials? Every example of their api involves you supplying a username and password. We can't have that. If they are logged into our web app with their network cred, they should be able to see a page on our Confluence Wiki w/o logging in again.
Is this possible/practical or should we just use our own help docs system?
Note - when I log into our Confluence Wiki I use my Win AD credentials, so the two systems are connected. I just have no clue how to send a user and their credentials to their system from my asp.net webpage.
Thanks.
You want to configure your Confluence server to accept NTLM Authentication. I can't find the specific directions for Confluence, but given it shares backend code with Team City, you might find these directions helpful: https://confluence.jetbrains.com/display/TCD9/NTLM+HTTP+Authentication
At the very least hopefully this helps you find what to Google next.
By the way, You don't want to setup your website to forward credentials. It is possible, but your scenario is a simple website redirect. Credential forwarding would be if your are trying to talk to the server as an application server (and even then generally to be avoided).

Is it possible to redirect mobile users only if they have an app installed?

I am currently working on a project for which there exists both a mobile app and a web site. One task can be performed on either the web site (meant for desktop users) or the app. Right now, the requested functionality for the site is as follows:
If a desktop user visits the web page, continue on that page as usual.
If a mobile user visits the web page, redirect them to the installed mobile app.
I have already implemented logic to tell whether the user is on a desktop or mobile device (most of the time, at least); however, it occurred to me that some users may not have the app installed, or that a desktop device could be incorrectly identified as a mobile device in the future. If a computer that does not have the app installed is redirected, they will encounter some error or an about:blank page. So, my question is, is there any way to tell whether a Response.Redirect to a mobile app will succeed?
So far I have investigated the HttpWebRequest/HttpWebResponse option to try and determine success or failure based on a requested page response prior to the redirect, but this does not seem like a valid option since a URL linked to an app will not provide a valid URI for the HttpWebRequest to test with. Any assistance or advice would be greatly appreciated. Thank you!
For clarification, the redirect looks something like this:
Response.Redirect("opencustomapp://SomePage?Parameter1=bar&Parameter2=foo");
The expected result is not to open a web page, but rather to interact with an app installed on the user's phone which has been mapped to this url.
EDIT: I have accepted the answer that it does not seem possible to do what I was asking for, but in case others have this problem, I wanted to attach some useful links to other questions about how to use a cookie to determine if the app is installed and how to redirect the user to some other place if the cookie is not set. For my own code, I will probably be going with a combination of a user-agent check and the setTimeout() function, as this can be implemented from code-behind using ClientScript.RegisterStartupScript without requiring any changes to the existing app.
No, there is no way to tell at the server if the redirect would succeed. This is because the redirect is sent back to the client from your server and executed at the client. Probably the best thing that you can do is use the mobile app to set a cookie for the website on the device, and then check for that cookie on the server side of the request... if it exists, redirect. Be careful to clear the cookie if they delete the app (if possible, not super familiar with mobile apps), otherwise the redirect would fail.

Facebook API allowing deauthorization of application

I know this question has been asked in the past, but times have changed and I am hoping the facebook SDK has progressed. I have seen other websites with the ability to deauthorize their app from the website rather than having the user sign in to facebook to do it. An example is glassdoor.com. If you create an account and then sync your FB account you can then deauthorize on the Account page. Any ideas on how this works because I have searched facebook docs and find only the deauthorization callback.
In graph API you can issue an HTTP DELETE request to /UID/permissions to revoke authorization for an app. Or you can use auth.revokeAuthorization from legacy REST API.
https://developers.facebook.com/docs/reference/rest/auth.revokeAuthorization/
hope this helps

How to post to Facebook user's profile?

On my site, user's post goods for sale (similar to Craigslis). I want to create the capability for user's to have it post to their facebook profile automatically from my site.
The scenario I'm imagining is this.
User creates an account on my site. In their profile, they allow my site to post to their facebook profile. From then on, anytime they post an ad, it automatically posts it to the facebook profile as well.
What do I need to do to create that agreement between my site and their facebook profile?
How do I actually post it to facebook? I'm developing in .NET/C# on ASP.NET MVC
Been hearing multiple stories on how to do this, not quite sure which to take and run with. Thus, I'm asking the experts here on StackOverflow! Thanks in advance!
A few resources that you might find helpful to get started :
Facebook Developer Site - Documentation for the API, forums, etc.
Facebook Developer Toolkit - a .NET library that provides access to the Facebook API
If you're looking to provide integration with facebook features on your site, you might want to look into Facebook Connect and its capabilities..
A while back I was looking at Facebook Connect and ASP.NET MVC and found these links helpful as well:
Making Facebook Connect work with ASP.Net MVC
http://singulartechnologies.com/integration-of-facebook-connect-with-asp-net-mvc
http://singulartechnologies.com/custom-asp-net-mvc-authorization-with-facebook-connect

Categories

Resources