Login Key

The Glance Login Key is a time-limited token issued by a partner or customer, used to authenticate a user to various Glance services.

The Login Key is passed on https: or glance: URLs in one of the following ways:

Appended to the username—for example, fred.glance.net (a Glance Address) after a tilde:

[username]~[loginkey]

Passed along with Partner IDand Partner User ID parameters, typically:

partnerid=[partnerid]&partneruserid=[partneruserid]~[loginkey]

A Glance user is uniquely identified by either a username or a Partner ID/Partner User ID pair.

Features of the Login Key

  • Uses current best practice SHA-2 family of hashes.
  • Expiration period selectable by the customer.
  • Includes algorithm versioning to allow future changes with backward compatibility.

Login Key Format

The Login Key format is identified by a leading dollar sign. (This distinguishes it from the previous format login key.)

Format:

$[ver]$[expirationtime]$[signature]

Example:

$1$1392680360$YsT2Kj8rOp6FaJOG69o3QOj-GUacRiOo7Gw6l1EPVB8

Login Key Components:

[ver] Must be 1 for this version of the key algorithm.

[expirationtime] The Unix (POSIX) epoch time. The number of seconds decimal since 00:00:00 UTC Jan 1 1970. Also, the value returned by javascriptDate.valueOfmethod integer divided by 1000. The key is valid until this time (current time must be less than [expirationtime]).

There is also a maximum time in the future for a valid expiration time (currently set to one day) to protect against possible accidentally generated keys with extended expiration times.

[signature] HMAC_SHA256:[apikey],[partnerid][partneruserid][version][expirationtime]

HMAC_SHA256: takes (secret key, message) arguments and generates a hash-based message authentication code.

NOTE: SHA-256is the 256 bit variant of SHA-2.The second (message) argument is the string concatenation of the four values. The HMAC must then be encoded as Base64URL (RFC 4648) without any trailing padding ("=") characters.

The resulting Login Key is 57 characters long.

By continuing to use the site, you agree to the use of cookies. Learn More