How to achieve nice litle USER page url like facebook or twitter? - account

I have a .NET app and I let users to create their account.
Right now the user page looks like http:///user/?user=guru
I have a user subfolder at the app root and that is where the aspx pages for user page are
How can I let my users access their pages like twitter, facebook or youtube?
Their user profile\channel\account has this format: http://www.facebook.com/guru
This way the URL is short and easy to remember and share
Thanks

This is called "url rewriting". You have some code that takes the original “facebook.com/guru” URL and coverts it into the “facebook.com/?user=guru” URL before the hosting application tries to process it.
Depending on your web server, there is probably a module already built that lets you do this. In IIS, you can either use a custom HttpModule or the URL rewriting module.

Related

Adding another Website URL to Facebook Login App

I am trying to add another website url to my facebook app in order to use the login functionality not only on one page but on both. Is it possible to do so, since I don't see the option to add a second website url.
Thanks in advance!
You need to add all the website url's you are using to the "Valid OAuth redirect URIs" you can find that under settings! or do you mean that you wanna use the same login for a different website because then the only way to do it is making another login functionality.

Determine if logged in via iframe on a static jekyll blog

I am trying to build an e-learning style site similar to KhanAcademy.org. I'd like to be able to use Jekyll for the main site on www.mydomain.com. In addition, I'd like a logged in view for the user as well which would live on learn.mydomain.com. I am trying to figure out how to do a redirect on www.mydomain.com (jekyll blog) and redirect the user to the subdomain if they're logged in. The one approach I can think of is to embed an iframe, and assert if the user is logged in and then do a redirect..Not sure if that's possible or would I need to communicate with the jekyll blog using postMessage()?
I really like this setup as I can start creating static content in a nice way on the main site, and if the user decides to then create an account and/or subscribe (pay) they will be redirected to the logged in user experience which I can build on a separate stack (node, express, react). Appreciate the help and any ideas on how to implement this. I plan on using auth0 for the logged in experience.

Facebook: webpage working as an app and a page

I want to make a webpage, that works as an APP (in facebook, iframe) and as a usual webpage too.
How can I accomplish this in a proper way?
Right now, I'm connecting to facebook as an APP with the PHP SDK: getLoginUrl(), then redirect the user to this url, blabla. Works fine if I'm in facebook, and using it as an app.
Problem is if the session is outdated, and I'm not looking this on facebook, this redirecting gets annoying, also: very unprofessional in my opinion...
Thanks in advance!
SOLVED: here's the solution for my specific problem:
It took me 1 change of line in the code, which is the following:
$canvaseurl = ($_SERVER['HTTP_REFERER'] == "https://apps.facebook.com/APPNAME/") ? "https://apps.facebook.com/APPNAME/": "https://MYWEBPAGE.hu/app/";
So I simply redirect to the url, where the user came from.
Pretty simple. :)
Once the person authorizes the application, you will be able to use either the iframe or the website, just so long as you don't force it to go back to the application page. I have used the Facebook PHP SDK and noticed that if you enter the actual location that is loading into the iframe it will stay on that page outside of the apps.facebook.com. However this is dependant on the settings you use. Try experimenting with it and see if that helps you.

Retrieving Page from HTTPS Website

I am registered user of a website that provides stock quotes values and I want to create a desktop application where in I will display the stock updates of a specific quotes.
For that, I need to parse a web page which is visible only when I login to the website. If I try to access that page, without logging in, it redirects me to the login page.
The Website does not provide any API for developing such a client application. Is there any way I can login to the website using the desktop client and thus access the required web page?
Regards,
TheLameProgrammer
You'll need to first do a HTTP POST to the login page, store the cookies that come back, then pass these along with any furture request you make.
Same as the browser does.
Hopefully this question is in earnest and not spam but the answer is no

Redirect to own site when user logs in via Facebook app

I am building an app with the functionality to publish
messages to users walls while specific actions runs on
my website.
What I have done is (briefly):
Registered my own app on Facebook
Added a login button on my website with permission
to publish:
Log in on Facebook
Downloaded facebook-php-sdk library
It is now I start having problems. I do not know how
to do what I want to do now.
What I want to do:
When a user logs on to facebook via my website. I want
a file on my site to be called, where I can update the
user's data in my own database as well.
Because that is not what the canvas url is meant to do? How it
is no, seems no file at all is called on my site when
I click on Login.
Since you are using the Facebook PHP-SDK you noticed that there are two options for the users to login:
Using the XFBML button, which will:
Open a login dialog (pop-up) asking for permissions..etc
When a successful authentication/authorization is complete the dialog will close, the auth.login event will be triggered and based on that the page will get reloaded window.location.reload();
The PHP in the top of the page will get into business and $session = $facebook->getSession(); will actually retrieve a session! $user = $facebook->getUser(); will retrieve the current user
Using the Login URL generated by the Library $loginUrl = $facebook->getLoginUrl(); this URL will get you through the same flow and if you noticed there's a next redirect_uri parameter which will redirect you back after a successful process to that URL (mainly the same URL you are at), where you can change that parameter if you like.
The canvas URL is the URL Facebook uses when it displays your application from within Facebook. You would use this functionality if you expect users to use your application while in Facebook itself.
When authenticating using Facebook's API (assuming graph API usage here), you provide a redirect_uri as part of the authentication URL. Once Facebook has authorized your application, it will redirect the user's web browser to the URI you specified. This URI can be any link you desire on your site. You should use the link as the determination of when the user is logged in successfully, e.g., https://mywebsite/facebook/loggedin.