Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Facebook session key question

Facebook session key question

Scheduled Pinned Locked Moved C#
questionphphtmlcomjson
8 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Etienne_123
    wrote on last edited by
    #1

    Hi I'm using a WebBrowser control to enable users to browse Facebook, or atleast this is my goal. Once I retrieved a Facebook session key, how do I redirect the browser to the Facebook Home page? Also, can I store a session key for each user and use this to log them in without having to prompt them for login details each time? I retrieve the session key by directing the web browser to the url below and then intercepting this url:

    browserFacebook.Navigate(@"http://www.facebook.com/login.php?api\_key=" + FacebookAPIKey + @"&connect_display=popup&v=1.0&
    next=http://www.facebook.com/connect/login\_success.html&cancel\_url=http://www.facebook.com/connect/login\_failure.html&
    fbconnect=true&return_session=true&session_key_only=true&req_perms=read_stream,publish_stream,offline_access");

    L 1 Reply Last reply
    0
    • E Etienne_123

      Hi I'm using a WebBrowser control to enable users to browse Facebook, or atleast this is my goal. Once I retrieved a Facebook session key, how do I redirect the browser to the Facebook Home page? Also, can I store a session key for each user and use this to log them in without having to prompt them for login details each time? I retrieve the session key by directing the web browser to the url below and then intercepting this url:

      browserFacebook.Navigate(@"http://www.facebook.com/login.php?api\_key=" + FacebookAPIKey + @"&connect_display=popup&v=1.0&
      next=http://www.facebook.com/connect/login\_success.html&cancel\_url=http://www.facebook.com/connect/login\_failure.html&
      fbconnect=true&return_session=true&session_key_only=true&req_perms=read_stream,publish_stream,offline_access");

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I'm not familiar with Facebook, but isn't the API key tied to the application? (As opposed to the user?) You can register your application here[^], and they'll provide a key for your application.

      I are Troll :suss:

      E 1 Reply Last reply
      0
      • L Lost User

        I'm not familiar with Facebook, but isn't the API key tied to the application? (As opposed to the user?) You can register your application here[^], and they'll provide a key for your application.

        I are Troll :suss:

        E Offline
        E Offline
        Etienne_123
        wrote on last edited by
        #3

        Yes it is, but I was talking about the session key, not the API key :)

        L 1 Reply Last reply
        0
        • E Etienne_123

          Yes it is, but I was talking about the session key, not the API key :)

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          The Session is only valid for 24 hours.

          I are Troll :suss:

          E 1 Reply Last reply
          0
          • L Lost User

            The Session is only valid for 24 hours.

            I are Troll :suss:

            E Offline
            E Offline
            Etienne_123
            wrote on last edited by
            #5

            Apparently not if you set the expiry time to 0. Anyway, I don't think this is the best way to try and implement single sign-on. I'm just giving it a shot since I'm kind of at a dead end. I've got all the users' usernames and passwords, I just need to find a way to log them in automatically :(

            L 1 Reply Last reply
            0
            • E Etienne_123

              Apparently not if you set the expiry time to 0. Anyway, I don't think this is the best way to try and implement single sign-on. I'm just giving it a shot since I'm kind of at a dead end. I've got all the users' usernames and passwords, I just need to find a way to log them in automatically :(

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Etienne_123 wrote:

              Apparently not if you set the expiry time to 0.

              Don't know where you got this information, but the docs[^] state something else;

              Users don't log out of desktop applications. A user's session expires after 24 hours,
              or when the user closes your application. If you need to, you can terminate a user's
              session by calling auth.expireSession.

              I are Troll :suss:

              E 1 Reply Last reply
              0
              • L Lost User

                Etienne_123 wrote:

                Apparently not if you set the expiry time to 0.

                Don't know where you got this information, but the docs[^] state something else;

                Users don't log out of desktop applications. A user's session expires after 24 hours,
                or when the user closes your application. If you need to, you can terminate a user's
                session by calling auth.expireSession.

                I are Troll :suss:

                E Offline
                E Offline
                Etienne_123
                wrote on last edited by
                #7

                Exactly - OR when the user closes the application. My application is meant to be run 24/7.

                L 1 Reply Last reply
                0
                • E Etienne_123

                  Exactly - OR when the user closes the application. My application is meant to be run 24/7.

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Is that a AND/OR or XOR? Sessions are usually temporary, and according to the docs I just been reading, you'd want to request "offline access". See the bottom of this[^] page.

                  I are Troll :suss:

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups