Skip to content
Snippets Groups Projects
Commit cfb3aed6 authored by Austin King's avatar Austin King
Browse files

Merge branch 'dev' of github.com:mozilla/browserid into dev

parents c425ebcc d5691980
No related branches found
No related tags found
No related merge requests found
......@@ -285,8 +285,17 @@ authentication page should include a javascript shim, hosted at:
### 6.1 Public Key Format
BrowserID public keys make use of Cryptographic Algorithms for JWS as [listed here](http://self-issued.info/docs/draft-ietf-jose-json-web-algorithms-00.html#SigningAlgs).
The private/public key pair can be generated using OpenSSL.
The public key is a JSON Web Algorihtms (JWA) public key as [listed here](http://self-issued.info/docs/draft-ietf-jose-json-web-algorithms-00.html#SigningAlgs).
The EyeDeeMe service has a [.well-known/browserid document](https://eyedee.me/.well-known/browserid)
that shows exactly what the [Mozilla Wiki](https://wiki.mozilla.org/Identity/BrowserID#Public_Key)
means in the example. The EyeDeeMee key is an [RSA public key](http://www.di-mgt.com.au/rsa_alg.html#keygen) than can be generated using OpenSSL.
Generate a public key JSON document in Ruby:
private_key = OpenSSL::PKey::RSA.new(1024)
public_key = private_key.public_key
{"algorithm"=> "RS", "n" => public_key.n.to_s, "e" => public_key.e.to_s }.to_json
### 6.2 Certificate Format
......
......@@ -21,7 +21,8 @@ const
winston = require("winston"),
configuration = require("./configuration"),
path = require('path'),
fs = require('fs');
fs = require('fs'),
urlparse = require('urlparse');
// go through the configuration and determine log location
// for now we only log to one place
......@@ -78,9 +79,17 @@ exports.userEntry = function(req) {
var ipAddress = req.connection.remoteAddress;
if (req.headers['x-real-ip']) ipAddress = req.headers['x-real-ip'];
var referer = null;
try {
// don't log more than we need
referer = urlparse(req.headers['referer']).originOnly().toString();
} catch(e) {
// ignore malformed referrers. just log null
}
exports.report('signin', {
browser: req.headers['user-agent'],
rp: req.headers['referer'],
rp: referer,
// IP address (this probably needs to be replaced with the X-forwarded-for value
ip: ipAddress
});
......
......@@ -8,6 +8,7 @@ const https = require('https');
// people to get issues, and the issues that were assigned to them
var people = {
'ozten': [],
'lloyd': [],
'shane-tomlinson': [],
'benadida': []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment