View Source SimpleOAuth

The following platform logins are supported:

  • Google
  • Wechat(APP/Web)
  • QQ

Configurations

Setup runtime configuration.

config :simple_oauth, [keyword configurations]

Google

config :simple_oauth,
  [
    google: [
      client_id: {client_id},
      client_secret: {client_secret},
      host: {host},
      scope: {scope}, # optional, default: "profile email"
      callback_path: {callback_path}, default: "/oauth/google/callback"
    ]
  ]

QQ

config :simple_oauth,
  [
    qq: [
      client_id: {client_id},
      client_secret: {client_secret},
      host: {host},
      callback_path: {callback_path}, default: "/oauth/qq/callback"
    ]
  ]

Wechat

config :simple_oauth,
  [
    wechat_web: [
      appid: {appid},
      secret: {secret}
    ]
  ]

  [
    wechat_app: [
      appid: {appid},
      secret: {secret}
    ]
  ]

Usage

SimpleOAuth.get_user_info(provider, code, runtime_config \\ compile_config)

Supported providers

  • google
  • wechat_app
  • wechat_web
  • qq