Skip to content

Instantly share code, notes, and snippets.

@azuby
Created March 13, 2012 19:43
Show Gist options
  • Save azuby/2031099 to your computer and use it in GitHub Desktop.
Save azuby/2031099 to your computer and use it in GitHub Desktop.

Step 1: Retrieve authenticity token

  • Request (phone)
`get :signin`
  • Response (Rails API)
`json: { :authenticity_token => "abc123" }`

Step 2: Create session and get session token

  • Request (phone)
`post :signin, {:username => "username", :password => "password", :auth_token => "abc123"}`
  • Response (Rails API)
`json: { :session_token => "abc123" }` user id, name, info?

Step 3: Store session token on phone

Step 4: Get some page

  • Request (phone)
`get :some_page, {:session_token => "abc123"}`
  • Response (Rails API)
`json: { :object_array => [ :object1 => params, :object2 => params ] }`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment