Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not sure that your developers would be able to securely do this without having some form of communication with their own host and some form of user account on their system. As you said, if you included a long-lived token in an app, no matter what obfuscation is done it could eventually be discovered by reverse engineering techniques.</p> <p>There are 2 options that I can see:</p> <h3>1. Short lived token</h3> <p>In this scheme the mobile application contacts the developer's system to receive an short auth token. During enrollment and periodically thereafter, developers generate a public-private keypair and give you the public key.</p> <p>Each auth token would need to include an unencrypted "developer key ID" of some sort and an encrypted bit of data including the token's issue data and a salt of pseudo-random data. The developer's host would encrypt the data using a private key in a public-private keypair. This keeps the secret in a controlled and secure space. The encrypted data needs to include the salt in order to prevent <a href="http://en.wikipedia.org/wiki/Known-plaintext_attack" rel="nofollow">known-plaintext attacks</a> on your developers' keys.</p> <p>The app sends the token to you, you can determine it's legitimacy by:</p> <ol> <li>Use the unencrypted developer key ID to determine which key to use in decrypting the encrypted string.</li> <li>Has the developer key ID been revoked or expired? (due to key compromise, dev API subscription expiration or abuse, etc). If it was revoked, deny access.</li> <li>Does the encrypted data in the token decrypt correctly? If not, deny access.</li> <li>Has the token expired? (based on the encrypted token date) If so, tell the client to get a new token from the dev server. Their software should do this before contacting your API, but you have to check just in case. I'd suggest that tokens be allowed to live for a relatively short time since copying a token between apps is a weakness.</li> <li>Allow access</li> </ol> <p>You could also use symmetric encryption instead of public-private key encryption, but then you and the dev both know the secret. It'd be more secure if only the dev knows it.</p> <h3>2. Pass API calls through dev host</h3> <p>It'd be possible for mobile applications to talk to their developer's host instead of your host for calls to the API. When the dev host receives one of the calls, it simply passes the call through to your API and adds their secret token.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload