Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8226457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:46:39+00:00 2026-06-07T15:46:39+00:00

RFC 2617 specifies the HTTP Basic and Digest Auth standard and works as summarised

  • 0

RFC 2617 specifies the HTTP Basic and Digest Auth standard and works as summarised in Wikipedia’s "Example with explanation" subsection:

  • The client asks for a page that requires authentication but does not provide a username and password. Typically this is because the user simply entered the address or followed a link to the page.
  • The server responds with the 401 "client-error" response code, providing the authentication realm and a randomly-generated, single-use value called a nonce.
  • At this point, the browser will present the authentication realm (typically a description of the computer or system being accessed) to the user and prompt for a username and password. The user may decide to cancel at this point.
  • Once a username and password have been supplied, the client re-sends the same request but adds an authentication header that includes the response code.
  • In this example, the server accepts the authentication and the page is returned. If the username is invalid and/or the password is incorrect, the server might return the "401" response code and the client would prompt the user again.

Note: A client may already have the required username and password without needing to prompt the user, e.g. if they have previously been stored by a web browser.

I am performing login using OAuth2 draft-standard as implemented by Facebook.

Given a server with an exposed public API (e.g.: JSONRPC or REST), how could the client-side JavaScript frontend be written to include the sort of functionality as the previously mentioned RFC 2617 example, but for Facebook auth?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:46:42+00:00Added an answer on June 7, 2026 at 3:46 pm

    I have found an official (but unmaintained and now officially abandoned) repository of example client-side JavaScript library implementation examples, click here for most recent fork. Here is the JQuery example from that page:

    <head>
          <meta http-equiv="content-type" content="text/html; charset=utf-8">
          <title>Connect JavaScript - jQuery Login Example</title>
      </head>
      <body>
          <h1>Connect JavaScript - jQuery Login Example</h1>
          <div>
              <button id="login">Login</button>
              <button id="logout">Logout</button>
              <button id="disconnect">Disconnect</button>
          </div>
          <div id="user-info" style="display: none;"></div>
          <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js">
        </script>
      <div id="fb-root"></div>
      <script src="http://connect.facebook.net/en_US/all.js"></script>
      <script>
          // initialize the library with the API key
          FB.init({
              apiKey: '48f06bc570aaf9ed454699ec4fe416df'
          });
    
    
          // fetch the status on load
          FB.getLoginStatus(handleSessionResponse);
    
          $('#login').bind('click', function () {
              FB.login(handleSessionResponse);
          });
    
    
          $('#logout').bind('click', function () {
              FB.logout(handleSessionResponse);
          });
    
          $('#disconnect').bind('click', function () {
              FB.api({
                  method: 'Auth.revokeAuthorization'
              }, function (response) {
                  clearDisplay();
              });
          });
    
          // no user, clear display
          function clearDisplay() {
              $('#user-info').hide('fast');
          }
    
          // handle a session response from any of the auth related calls
          function handleSessionResponse(response) {
              // if we dont have a session, just hide the user info
              if (!response.session) {
                  clearDisplay();
                  return;
              }
    
              // if we have a session, query for the user's profile picture and name
              FB.api({
                  method: 'fql.query',
                  query: 'SELECT name, pic FROM profile WHERE id=' + FB.getSession().uid
              },
    
              function (response) {
                  var user = response[0];
                  $('#user-info').html('<img src="' + user.pic + '">' + user.name).show('fast');
              });
          }
      </script>
    

    Feel free to suggest improvements. Optimally I would like to see:

    • Vanilla JavaScript implementation
    • JSONRPC calls to facilitate login on personal server-end
    • Routing (i.e.: redirect to signed-in user homepage on successful login)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

RFC Standard says the max email size is 320 (actually 256 according to http://www.dominicsayers.com/isemail/
There's one thing I haven't found in RFC 2616 ("Hypertext Transfer Protocol -- HTTP/1.1")
According to https://www.rfc-editor.org/rfc/rfc3986 and http://en.wikipedia.org/wiki/Uniform_resource_identifier , a URI may or may not contain a
There is a standard two-pass algorithm mentioned in RFC 1942: http://www.ietf.org/rfc/rfc1942.txt however I haven't
I've read through RFC 2617 and can't find there or anywhere else what the
According to the RFC , individual cookies in the Cookie HTTP header may be
Is there an RFC, official standard, or template for creating a User Agent string?
The HTTP 1.1 RFC restricts a Client from using more than Two TCP connections
The HTTP/1.1 RFC stipulates The HEAD method is identical to GET except that the
The RFC seems to suggest that the client should permanently cache the response: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.