目录

Persona Gmail Bridge

A minimal identity bridge for Gmail.

Getting Started

Running is simple:

  1. git clone https://github.com/mozilla/persona-gmail-bridge.git
  2. cd persona-gmail-bridge
  3. npm install
  4. npm start

For local development, set the SHIMMED_PRIMARIES environment variable for gmail.com and googlemail.com before you start up Persona:

  1. cd /path/to/persona
  2. export SHIMMED_PRIMARIES='gmail.com|http://127.0.0.1:3000|/path/to/persona-gmail-bridge/var/well-known.json,googlemail.com|http://127.0.0.1:3000|/path/to/persona-gmail-bridge/var/well-known.json'
  3. npm start

You’re done!

Visit http://127.0.0.1:10001/ and try signing in with your Gmail account!

Testing

  1. npm test

You’re done!

Configuration

For information on what parameters can be configured, please review lib/config.js.

You can set values via individual environment variables, or you can set CONFIG_FILES to point to JSON files containing settings. To pass multiple files, concatenate their paths with commas.

Example:

CONFIG_FILES='/app/foo.json,/app/bar.json' npm start

Local testing shouldn’t require changing any settings.

Production deployments must change:

  • server.publicUrl and server.personaUrl
  • cert.pubKeyPath and cert.privKeyPath
  • session.secret

Production deployments may want to change:

  • server.port and server.host
  • logPath
  • proxy.host and proxy.port
  • statsd.enabled, statsd.host, and statsd.port

StatsD

If enabled, the bridge can report statistics via statsd:

Counters

authentication.forwarding.success
authentication.forwarding.failure.bad_input
authentication.forwarding.failure.openid_error

authentication.openid.success
authentication.openid.failure.bad_result
authentication.openid.failure.cancelled
authentication.openid.failure.mismatch
authentication.openid.failure.no_claim

certification.success
certification.failure.no_proof
certification.failure.invalid_pubkey
certification.failure.signing_error

response_code.{code} -- on every response

Timers

routes.{path}.{method} -- on every request
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号