Organizing a secure channel between a Web app and a Native app

后端 未结 5 2050
清歌不尽
清歌不尽 2020-12-15 00:28

This question is kinda complimentary to \"Share credentials between native app and web site\", as we aim to share secrets in the opposite direction.

TL;TR:

5条回答
  •  没有蜡笔的小新
    2020-12-15 01:11

    As you mentioned, using a custom protocol handler is not a safe way to pass secrets, since another app may handle your protocol and intercept that secret.

    If you are imposing a strict constraint that the communication channel between the native app and the web app is initiated from the web app, and that the native app has not previously established a secure channel (e.g. shared secret which could encrypt other secrets), then it is not possible to safely transmit a secret to the native app.

    Imagine if this were possible, then PKCE would be redundant in an OAuth 2.0 Code Flow, since the server could have safely transmitted the access token in response to the authorization request, instead of requiring the code_verifier to be provided with the grant when obtaining the access token.

提交回复
热议问题