Draft guidance for developers on how to manage OAuth secrets and app confidentiality, including guidance for mobile and desktop apps.
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:
- When using the authorization code flow, the client must use a PKCE code challenge and the client credentials are not evaluated when exchanging an authorization code for an access token.
- The client cannot use the client credentials flow.
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."