Facebook Authentication in Background - C# sdk - c#

I am developing a windows phone app using facebook c# sdk. I created a login page to authenticate the user and it also working well. But my problem is, next time when the user open the app, it should be navigated to main page and do the authentication work in background. Is there anyway to do this??
I used navigatedto override method to "redirect the user into the mainpage". I dont know how to authenticate the user in background. Help plss..

save token (received from fb) in ur isolated storage & check if it invalid in ur HomePage and so accordingly navigate to Login (if invalid)

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

API generated Bearer Token to login automatically over web GUI?

I'm developing a web application with C # and netcore, which includes an API module.
Then there is a windows WPF application (programmed by me) that can connect to this API.
So when I log in into my WPF application I check the credentials over the API's call and grant access to the user. In this WPF Application is a Button that will forward you to the Web version.
Is it now possible to hand over the generated bearer token from WPF App to my login in the web to grant the user access without using again his credentials?
I expect that the user just need to use his credentials in WPF App and is logged in in the browser too.
Thank you in advance and have a nice day.
I guess you store the token on the Web version and if you open it in the browser it will already be logged in and redirected to a specific page. In case the token cannot be retrieved or it is expired, then you will stay on the login page.
I would suggest you to pass the token to the login page as parameter in the URL from your WPF app. So at this point after you check if you already have a token stored, you can also check if you have any parameter passed, store that one and redirect to the page you want.

How to logout using facebook sdk in windoows phone app

I am using Facebook sdk to integrate Facebook in my app. I have used Login button to log in into Facebook which redirects me to Facebook Login page automatically, means by providing your appId. But the problem is that when I click on Logout button it successfully logs me out of the app but when I click on Login button again it doesn't ask for any user login and password (it doesn't redirect me to Facebook Login page, but directly redirects to my apps home page).
How to destroy all cache/session info?
You can not using Facebook SDK API. Facebook proposes,
Windows Phone apps must create their own way of storing when a person
has logged in, and when that indicator is not there, proceed on the
assumption that they are logged out. If someone is logged out, then
your app should redirect them to the Login dialog at an appropriate
time — for example if they click a Login button.
This Official page might throw more light on it.
Basically, you need to have a flag stored somewhere in Isolated storage, that can be set to rue of false as and when user logs in and out...and redirect him to login.
Well, on a lighter note, its not less known fact that Facebook Logout button is a hardest button to find.. :) Hope this helps...

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

WP7 Facebook SDK - Connecting the user automatically

I'm currently writing a facebook app for windows phone, and there is something I just didn't find how to do.
Since display=touch currently doesn't work on windows phone, I am forced to use display=popup to get a token and the user's agreement for my app.
This popup mode really isn't fit for mobile apps, so I would like the user to be able to check a box saying "I would like the app to remember my login and password and connect me automatically".
However, when I have the user's login and password, I don't know how to use the OAuth API to effectively login the user without him having to click anything. Is there a way to do that ? Or do I have to wait for the user to choose "Remember me" on the Facebook login page ?
I hope that was clear enough.
Facebook doesn't have a (public) API for taking a users email address and password and returning an access token. The closest thing you can do is customize the HTML that gets returned with JavaScript. I have an example of this on my github.

Categories

Resources