Page MenuHomePhabricator

API Portal: Document security best practices
Open, Needs TriagePublic

Description

Draft guidance for developers on how to manage OAuth secrets and app confidentiality, including guidance for mobile and desktop apps.

Client confidentiality

When creating a client, the OAuth extension supports a checkbox for "Client is confidential: A confidential client is an application that is capable of keeping a client password confidential to the world. Non-confidential clients are less secure". For the API Portal, our current working copy for this checkbox is: "I can keep my app credentials secure" with a link out to a documentation page.

From the backend perspective, this is a purely self-reported field. There's no way for the extension to know whether the credentials are actually secure or not. If a user doesn't check the box, two things happen:

  1. When using the authorization code flow, the client must use a PKCE code challenge[1] and the client credentials are not evaluated when exchanging an authorization code for an access token[2].
  2. The client cannot use the client credentials flow[3].
Guidance for mobile and desktop apps

From OAuth for Developers, "The application secret must be kept secret. Submitting it to source control or putting it into user-accessible code (such as mobile app or desktop application; even if it is obfuscated) undermines the security model and will result in admins forcefully disabling the application. Exceptions are made for example applications demoing OAuth usage, if they are explicitly labeled as such and request limited rights."

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 18 2020, 8:56 PM
apaskulin renamed this task from Define security best practices to API Portal: Document security best practices.Mon, Jun 15, 8:31 PM
apaskulin updated the task description. (Show Details)Tue, Jun 30, 12:05 AM
apaskulin updated the task description. (Show Details)Tue, Jun 30, 3:42 PM