Realm SyncUser.authenticate failed with Google's clientID and Facebook

故事扮演 提交于 2019-12-06 11:56:34

Unfortunately, there is a bug in the sample configuration.yml file shipped with Realm Object Server which I suspect you're hitting. The providers: section in the configuration file should live under the auth: section (instead of inside the network: section where it lives in the shipped file). The fix is to simply move the relevant providers configuration to live under the auth: key.

We have a fix ready for this bug which will be part of the next release of Realm Object Server.

Here's a sample snippet showing the complete auth: section with the fix:

# Realm Object Server Configuration
#
# For each possible setting, the commented out values are the default values
# unless another default is mentioned explicitly.
#
# Paths specified in this file can be either absolute or relative.
# Relative paths are relative to the current working directory.

auth:
  ## The path to the public and private keys (in PEM format) that will be used
  ## to validate identity tokens sent by clients.
  ## These configuration options are MANDATORY.
  public_key_path: /etc/realm/token-signature.pub
  private_key_path: /etc/realm/token-signature.key

  providers:
    ## Providers of authentication tokens. Each provider has a configuration
    ## object associated with it. If a provider is included here and its
    ## configuration is valid, it will be enabled.

    ## Possible providers: cloudkit, debug, facebook, realm, password
    ## Providers 'realm' and 'password' are always enabled:
    ## - The 'realm' provider is used to derive access tokens from a refresh token.
    ## - The 'password' provider is required for the dashboard to work. It supports
    ##   authentication through username/password and uses a PBKDF2 implementation.

    ## This enables authentication via a Google Sign-In access token for a
    ## specific app.
    google:
      ## The client ID as retrieved when setting up the app in the Google
      ## Developer Console.
      clientId: '<SOME-HASH-HERE>.apps.googleusercontent.com'

    ## This enables authentication via a Facebook access token for a specific app.
    ## This provider needs no configuration (uncommenting the next line enables it).
    facebook: {}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!