Overview of the samples in this directory: ------------------------------------------- The samples have been unified into a single rails project for simplicity. openid-combined-consumer: ------------------------- This sample demonstrates an OpenID "Combined Consumer" by implementing the openid/oauth "hybrid" spec as specified at: http://step2.googlecode.com/svn/spec/openid_oauth_extension/latest/openid_oauth_extension.html This sample also demostrates the interaction with MySpace using the MySpace library to fetch the user's profile and friends data oauth: ------ This sample demonstrates an OAuth Consumer application by implementing the oauth delegated access flow ("3 legged oauth"). Once the User authrizes the Consumer's request, it fetches the user's profile and friend information using the library. NOTE: Please note that in the samples above we store the access token in the session. But, in a real application you would probably need to store it an the user database so that you can call the MySpace API methods in the future using the stored access token 8-bit Music: ------------ This sample demonstrates using a popup window with directed identity to do OpenID/OAuth without leaving the main page. It also demonstrates activity streams. Running the sample applications: -------------------------------- The samples provided in this directory are based on Ruby on Rails 2.2. Most of these files are boilerplate code generated by rails. The main files to look at are: sample/app/controllers/openid_controller.rb sample/app/views/openid/index.rhtml sample/app/controllers/oauth_controller.rb sample/app/views/oauth/index.rhtml sample/app/views/oauth/profile.rhtml sample/app/controllers/user_controller.rb sample/app/views/user/index.rhtml sample/app/views/user/complete.rhtml sample/public/javascripts/myspaceid.rev.0.js To run the samples, please follow these steps: 1. Type `server/start' from the sample root directory (samples/rails/sample). This should fire up your local instance of the web server and will start listening on port 3000 2. You can access the sample from your browser by navigating to http://localhost:3000 The application key and secret that come with the SDK will only work if you are running the web server on localhost, i.e. the same machine as the web browser you are using. If you want to run the code on a different machine, you must go to: http://developer.myspace.com/modules/apps/pages/CreateAppAccount.aspx to create a new MySpace application. Make sure to select the "Create MySpaceID App" link and complete the application creation process. Copy the new application's consumer key and secret to the file consumer_key.rb located in the same directory as this README. IMPORTANT: The domain on which you run your server MUST be entered as a realm on your MySpace app configuration page. In order for the rails samples to work you MUST INCLUDE A SLASH AT THE END OF YOUR DOMAIN, e.g. http://your-domain:3000/, when you enter it as a realm.