Get Token from web site and pass it back to WPF - c#

I need information about how am I suppose to get a token from an external browser passed to my WPF application.
The user will click a button on my WPF which will launch a chrome browser, then the user will log in and after they do, I have to get the access_token passed back to my WPF.
Something like google authentication, when you sign in to a desktop application using google, you get a new tab on your browser, you sign in and then you return to the web application to find it signed in automatically.
I want to build something like this, if possible!

There is a google sample app online that you can reference for how to do this in WPF.
https://github.com/googlesamples/oauth-apps-for-windows
Specifically, the WPF app is the one named 'OAuthDesktopApp'.

Related

Auto login to itslearning using C#

I want to auto login to a website (itslearning.com) and then display it in my Windows Forms Application with CefSharp.
It would be easy to do this with itslearning eLogin (https://developer.itslearning.com/Single_Sign-On_and_Authentication.html#284208891), but unfortunately my school doesn't support it.
Is there any other way to automatically login to my schools itslearning page?
May be save the login cookies? Or doing the same thing as the itslearning native app for mobile phones. The app uses OAuth2 for authentication. When you click on a link in the app (e.g. for the Dashobard) it opens the browser and you are automatically logged in.
I figured it out.
You can just use the itslearning Rest API:
www.itslearning.com/restapi/help

"You should avoid this app" when trying to connect Google Analytics to our app

We are receiving this popup (in multiple browsers, not just Chrome) when our users are trying to connect Google Analytics from inside of our web application. Previously, the user could hit Advanced and just acknowledge the popup and move on, but that isn't possible any longer. If you've received this popup, how did you get around it?
This is an Angular 1.7 app on the client-side and a C# web API on the back-end.
You can get your app Google Verified, that's the absolute best way to solve it.
You can try adding one of the users (yourself, or someone you can trust?) to the API IAM with the role of "Editor" which should allow that person to access it at least.

C# Windows Forms Spotify API User Authorization

I'm trying to authorize a spotify user in my windows forms application. I am able to make a GET call to the web API, and I get a response back that is HTML. When loaded into the browser, this HTML is a login page, but my question is two parts.
1) What would be the best way to display this login page. Obviously if I could launch the browser and have it return the authorization code somehow, that would be best, which brings me to my second question.
2) How would I get the authorization code from the browser when I launch the login screen? I can't see a way that my forms application would be able to receive any information after the login screen is launched. Sorry if this seems obvious.
I figured it out, the URL I was using was not meant to be requested from, but to have the user navigate to in their browser. I basically just put the link in my application as a button and it would launch in chrome. Once the user logs in, I used http://httpbin.org/get to display the authentication code and just copied the code into my app as a temporary fix. Obviously this is not ready for release, and I am still working out how to get the code from the redirect url to my application, but it's a step in the right direction!
1) You can display a web browser inside your form to do the login part.
2) Browsers like Chrome can't return values. You could look at the data sent / received from your browser and search for an authentication token or something like that

first run page on wp8?

So I'm creating an app that uses Facebook and Twitter features so I want when the app is first installed to be able to run a page that allows them to setup facebook and twitter first. Like for example the Twitter setup page is TwitterSetup.xaml and FB setup is FacebookSetup.xaml. How do I code a first-run page?
When you start the App, you need to check if the User entered the data you need (Twitter or Facebook login for example). To do this you can use IsolatedStorageSettings or local storage (as posted by #manojlds here).
For example you add code in MainPage(), that loads Settings or Storage and checks if the user has already entered what you need, if not - then you navigate him to the right Page.

Pass cookie to WebBrowser in Windows Phone 8

I am currently developing an app that uses a public API. After performing the login procedure with that API, I get a cookie that I store in my app. I need to pass this cookie with every API call, that I request. So far so good.
Now unfortunately this API doesn't give me acces to all features of the service. What I want to do is giving the users of my app a button, which open a WebBrowser for that specific features. The problem is, that the user is, of course, not logged in in that WebBrowser.
What I found out on my PC is, that the login-cookie, that I get from the API, would actually work for the website itself as well. So what I want to do is: When the user clicks on the button, it opens the WebBrowser and passes the login cookie I already have to the WebBrowser, so the user is already logged in and can use the feature. Is there any solution for that problem? I couldn't an answer for that.
Cheers! :)
You can only set cookies from invoking javascript on the page when loading is completed.
Windows Phone WebBrowser set cookies

Categories

Resources