applivery/applivery-ios-sdk

Display Applivery User Authentication before installing new versions

CesarTrigo opened this issue · 2 comments

Store and always use the new API Key after a successful login. Do not ask again for a login once the user is authenticated and the new token is available.
Do not allow new installations if authentication fails.

Workflow:

  1. User opens the app
  2. SDK checks for new versions and displays Update prompt / Force Update screen
  3. Display User login if a new version is available and the field sdk.ios.updateAuth = true
    3.1. If authentication is OK: store new token and flag to not ask again
    3.2. If authentication fails: display error message Invalid credentials (translated)
  4. If the flag = true use the new token to download new versions
    4.1. If token expires or 401/402 responses are received: clean and show login again

Authentication endpoint available in POSTMAN: https://www.applivery.com/docs/rest-api/postman

Authentication Headers summary:

  • /auth -> No tokens needed
  • /app/{{app_id}}
    • Authentication: {{sdk_api_key}}
    • x_account_token: {{sdk_api_key}}
  • /builds/{{build_id}}/token ->
    • Authorization: {{user_access_token}}. If not available use {{sdk_api_key}}
    • x_account_token: {{sdk_api_key}}
  • /download/{{build_id}}/manifest/{{download_token}} ->
    • Authorization: {{user_access_token}}. If not available use {{sdk_api_key}}
    • x_account_token: {{sdk_api_key}}

Additionally, it's still pending:

  • Store {{user_access_token}} after successful login