Third argument in "process.start()" method C#? - c#

I used to want my program to open iexplore.exe, and then connect to facebook.com.
Now I want the program to enter the users username into Facebook. Is there any way to use a
third argument in process.start() method?
Thanks in advance :)

To open internet explorer and browse the Facebok page you could do something like the below:
Process.Start("IExplore.exe", "www.facebook.com");
For what I have understand after that you want to put the user name into the Facebook page which cannot be done using Process.Start().
I think the only way you have to do that is by using a web-driver(like Selenium) framework which allows you to "play" with the Web UI
more info at :
http://www.qaautomation.net/?p=373

To answer your question: NO - there is no way to use process.Start in that way.
However, I am sure that it can be done using other methods.
Sources:
Personal Experience,
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx

Some websites might still respond to the http://username:password#domain/folder/page syntax but unfortunately Facebook requires you to input the username and password into textboxes in the actual page.
To handle that, you might get by by simulating a POST request posting the username and password, retrieving whatever it is that Facebook returns that would allow you to continue authenticating to Facebook, but this is going to be specific for Facebook, not something inherent in the http protocol.
In other words, since you want to fork off for iexplore.exe to open Facebook, you're going to have to persuade iexplore.exe to input the username and password and then submit it, which to be honest, I hope is not going to be easy or at all possible.
You could try allowing for Internet Explorer to open the webpage, and then post keypresses to it to simulate the user typing in the username and password.
OR... you could create an addin for Internet Explorer like LastPass, that would input the username and password at the right time.
But... neither would be easy to do.

Related

WebView2 WPF Google log in

Easy question, not sure if there is a solution for this problem.
I made a simple browser with WebView2 in a WPF C# app (I made this to be able to use a shell app while I browse on the url where the webview is). It use the same useragent as edge-chromium and until some months ago I was able to log in to google like in a regular browser.
Now if I try to log in I get a "Not supported browser" error from google.
Of course nothing changed in my application, but google say that it will not support log in from a webview ("browser that: Are embedded in a different application"):
https://support.google.com/accounts/answer/7675428?hl=en-GB
I don't really know if there is any workaround for this. I know that I was logged yesterday (and I think that it was possible thanks to the cache or something like that) so if there is a workaround to log in I should be able to stay log in. I know they suggest to use the google API:
https://developers.google.com/identity/protocols/oauth2/native-app
And I already used that in a Unity3d game to log in to my google drive. But I'm not sure how to set my WebView2 to be logged in when I call that API (I know that I can use the response to make new API call and, for example, upload a file to my google drive, but I don't know how to set my webview to be logged and be able to go to google drive url and be logged in any google app).
My question is if you know how to solve this problem or if you got any idea on how to solve it. Or do you think that's not possible at all?
EDIT.
just find out this is a problem with any webview. like you can see here github.com/MicrosoftEdge/WebView2Feedback/issues/1647 it's a security bullshit of google that, instead of finding a solution, blocked every webview out ther from log in to their services (they could solve the man in the middle problem in many ways like asking for a password app, ask for a more limited webview sandbox window etc... they just blocked everything).
So there is not really any solution for this. Even by using Oauth API you can only log in and wait for the response but you cannot access google like in a regular browser with that, you can only make more API call... that's not what I need.
The only solution that I can think of is to just wait for microsoft or someone else to make a "sandbox environment" that will activate by default in a log in page of google (and that google will allow to log in), and will revert back to the regular webview once it is logged in.

Using OWIN to validate STEAM user login without identity

I have been browsing endlessly without really finding the answer i am looking for.
It may even be a stupid question answered in some others form, then please direct me there.
Basically, what i need is a button that redirects to Steams logon page where the user can login with his Steam user. When he successfully does, I just need the returned SteamId, and thats bacsically it! I dont need Steam as a login service, but more as a verfication method that the provided Steam user is who he says he is - i have my own login system for user etc, which is irrelevant.
I have tried using Owin's part that has steam as OpenID provider, but for the love of me i cant figure out how to untangle it to the simple thing i need.
Any ideas on how to do this?
Thanks in advance!

Validate Yahoo and Gmail Login

I am required to write a small webpage / utility for both Google and Yahoo to validate their email addresses. Suppose I give two textboxes, one for Yahoo and the other for Google. When the user provides the email addresses and hit the GO button I want to show if the provided emails actually exist and are valid or not. Plus, I would also like to show any publicly available information like Name, Date of Creation of Account or anything else that is available.
I have tried searching the net but was unable to find any helpful material. Hence asking the question here.
Sounds like you need to implement oauth in your application. By doing so, the user can click on the button of a network and login there. The user will be redirected back to your application with some details (depending on the settings), in most cases you will get the email address and user name.
The simplest way to implement oauth I found was with Simple Authentication: https://github.com/SimpleAuthentication/SimpleAuthentication
An implementation I made: http://www.zonneprijzen.nl/Account after login go to: http://www.zonneprijzen.nl/User/Edit
Hopefully this solved your problem.

Login by pass using C#.net program

My goal is to provide a link to customer, when a customer clicks the link he/she should be automatically logged in to this new site(external website not controlled by our company) using their logged in AD credentials.
FYI, the logged in credentials match the login name on this external website and the password will be the same for all. So, I can safely hardcode the password in my program.
Now what I was thinking was to write a C# program that will complete the authentication process for the External website and returns back the page that is received after login.
My analysis:-
1) When I first visit the page http://website2/default.aspx, it returns back a login page with username, password and submit button.
I also noticed that it is returning a session id.
*ASP.NET_SessionId=i0j3d155mxxkuyr3fedp00yf*.
2) Later, when I enter username, password and click the submit button.
It is creating a query string as such
user=adf&password=adsf&buttonName=Login+%21
I think it is using an HTTP Post call.
Can you please help me this!!!! Please, if possible provide me with a code that I can refer to and make changes to acheive this.....
Thanks a lot for looking....Any help is appreciated.....
You're not going to be able to do this since there is no way to retrieve a password from AD. The only way this would be possible is if there was a trust relationship between the external site and yours and it sounds like this is not the case (please correct me if I'm wrong!).
You'll need to have the user manually enter authentication and marshal that information to the external site, which is really no better than just having the user authenticate directly to the external site.
On a side note, it's rarely the case where you can safely hardcode a password in a program. Just sayin. Also, if you're getting a query string that you can see in the browser's address bar then it's not using POST, it's using GET.

automatic login to facebook

I'm creating a desktop application in C#.
one of the things that this application should do is to publish things to the status of the user in facebook (like: "dave just won 3 gold medals" ). this should happen whether the user is logged in now to facebook or not. I want the user to give me all the needed permissions once and then everything would happen automatically (I would save whatever is needed on my DB).
I tried using facebook developer toolkit 2.0 for .net but didn't see anything there that could help me.
ANY help would be appreciated.
For you question:
you need to use the Facebook Connect API
there is a Feature called offline_access - its an extended permission.
In FB Connect you need to toggle the correct popup :
The workflow will be like that:
User uses FB Connect to confirm the fact he wants to connect your app to his facebook account.
You trigger the popup.
You can then call all calls on his permission even if he is offline (or not using facebook connect)
For the sake of understanding: FB Connect is meant that way that you can easily log the user into his app and do everything on his behalf. offline_access is actually meant for cronjob work.
Iv'e got some answers here. I think it answers other questions I saw in the web lately:
My answer is related to desktop applications that works outside of facebook (facebook connect).
+ I'm using the facebook developer toolkit 2.1:
Here is how to get the special permission, needed to for offline access. and how to get the session key:
facebook.Components.FacebookService FS = new facebook.Components.FacebookService();
FS.GetExtendedPermission(facebook.Types.Enums.Extended_Permissions.offline_access);
The second line will force you to login and afterwards would ask for the permission after the user choose to grant the permission, you are given in the post URL - the fb_si_session_key. BUT the toolkit developers didn't do enough to bring it to you :-(
So you have few options. the simple one is to do:
FS.Logoff();
FS.ConnectToFacebook();
What will happen is that you'll see the login screen for a second and before youll be able to click anything it would vanish. but this time you'll have the right session key. you can get it like that:
string myPermanentSessionKey = FS.API.SessionKey;
If you dont want to show that annoying screen again you have few options, all of them are related to changing the source files of the toolkit. I'm not gonna get into it here, but just tell you a simple option: in the facebookconnect() function I changed it to receive a parameter (isShow) when I send true to it, it behaves normal, when I send false to it - it skips on the formLogin.ShowDialog();
It's working.

Categories