login-and-signup

term: account - always references Ubuntu One account of type com.ubuntu with auth token type ubuntuone

New Activities

LoginActivity

New Fragments

LoginFragment

  • show log in form
  • there is an account with token != null

    • true: the token is valid?
      • true: finish with RESULT_OK
  • user hits log in button

SignupFragment

ValidateFragment

  • an account does not exist
    • show log in form, stop
  • tell the user to click the link in the e-mail
  • every few seconds, as long as fragment is not in paused state, execute ValidateAccountTask

New AsyncTasks

RegisterUserTask

ValidateAccountTask

  • use sso api me() method to determine if preferredEmail != null (and != "null")

    • true: set account token in AccountManager to what userData with authTokenHint holds, and clear userData with authTokenHint key, callback with success

    • false: callback with failure

AuthenticateUserTask

  • generate an OAuth token for the app
  • create an account in AccountManager

  • save the OAuth token as userData with key authTokenHint

  • switch to ValidateFragment

mkarnicki/u1f/login-and-signup (last edited 2011-11-22 21:15:09 by 178-73-27-165)