Subscribe: ignisvulpis
Added By: Feedage Forager Feedage Grade B rated
Language: English
connect  endpoint https  firefox  google  https connect  https  identity  login  mobile  openid  org  token  user  wallet 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: ignisvulpis


Updated: 2018-03-18T16:45:57.451+01:00


Minimize Ladder Length over Wall


Some time ago somebody had to solve this math optimization question for their studies and told me about it.

So there is a wall with height h, which has the distance a from a very high "building" and your task, should you accept it, is to find the shortest ladder over the wall that touches the ground and the "building".
So the function to minimize is L = sqrt((x+a)^2+(h+y)^2).
Because we know that y/a = h/x it follows that y = ah/x.
Using this the length become L = sqrt((x+a)^2+(h+ah/x)^2)
The minimum of that function is not changed if we leave out the sqrt and the derivation of (x+a)^2+(h+ah/x)^2 is (2 (a + x) (-a h^2 + x^3))/x^3
So the minimum x is where this function equals zero, which is if x³ = ah²,
and the length then is L = (a^(2/3) + h^(2/3))^3
Now the thing that I find strange. Please look at this drawing (which is not really correct because the two "y" do not have the same length).

If the angle ACD is 90° then the ladder has minimal length!
We know that ah=xy, so let's square that: a²h²=x²y² and because ACD is 90° xa=y² which yields

a²h²=x²xa and that gives x³=ah² which is exactly what we got by using the calculus.

Do you have a geometric explanation why L is minimal if ACD is 90°?



CSS Oddities: anonymous inline whitespace nodes


I learned something today. All started with a @Twitter post by @supersole that there is a new feature in @firefoxnighly that now allows debugging "anonymous inline whitespace" nodes in HTML pages.

The post claims that imgimg on the page is rendered differently than (image) imgcrlfwhitespacecrlf(image) img.
I could not believe this. That is stupid right? Which web developer would expect any difference?

Well, it seems that CSS rules - being what they currently are - lead to this unexpected difference.
The CSS spec describes the algorithm to process the HTML here in Phase I: Collapsing and Transformation.
In the second HTML fragment the whitespace is deleted by step 2 which gives us 
(image) imgcrlfcrlf(image) img.
Step 2 tells us to handle segment breaks ("crlf"). That is described in the Segment Break Transformation Rules.
Those rule give us imgspacespaceimg(image) . Which is then again continued to be processed by the Phase I steps 3 and 4. Step 3 does nothing in this example.

Step 4 reads:
Any space immediately following another collapsible space—even one outside the boundary of the inline containing that space, provided they are both within the same inline formatting context—is collapsed to have zero advance width. (It is invisible, but retains its soft wrap opportunity, if any.) 
 So the remaining two spaces are turned into one (or two - I don't care to check) empty text nodes with zero width but with "soft wrap".

Good to know - maybe. Is this a feature? I expected that everything between two HTMLElements that matches (whitespace)* is completely removed and not inserted into the rendering tree.

Maybe this should be discussed here?:
Not my cup of tea.

Thanks to @upsuper who pointed me to the relevant specs.


Twitter Markup


(image) Twitter Cards are around for some time now and I recently wondered how commonly used they are?

There is a nice blog post on Blogger on how to integrate them there but clearly there should be ways for e.g. newspapers to promote their reports by providing summaries and a main image and author information that is not @Twitter specific?  Microformats and to the rescue?

What does Google do? It seems that JSON-LD is the recommended format.

How would a Twitter Card look in JSON-LD?

Twitter Cards or Rich Cards or @w3c Cards?

Time to standardize!


New Firefox Add-On: QRCode Login


Current login mechanisms suffer from missing support by browsers and sites.Browsers offer in-browser password storage but that's about that.Standardized authentication methods like HTTP Digest Authentication and HTTP Basic Authentication were never really accepted by commercially successful sites. They work but the user experience is bad especially if the user does not have an account yet.So most sites are left with form-based authentication were the site has full control over the UI and UX. Sadly the browser has little to offer here to help the site or the user other then trying to identify signup and login forms through crude guesses based on password field existence.There is no standardized way for sites and browsers to work together.Here is a list of attempts to solve some of the above issues:All those NASCARs suggests navigator.openidMozilla's Persona / BrowserID suggests navigator.idThe OpenID Foudation's AccountChosser uses localstorage and redirectsThe W3C Credentialmanagement WG uses navigator.credentials Google's X-Auto-Login utilizes HTTP headersGoogle's requestAutocomplete for Google Wallet is proprietaryWebID uses URIs to identify entitiesXRI / inames gives you more than =jane...Federations have their drawbacks too. Even Facebook login went dark for 4h a while ago which left sites depending on Facebook without user login.In general there is this chicken-egg problem:Why should sites support new-mechanism-foo when there is no browser support.Why should browsers support new-mechanism-foo when there are no sites using it.Then there are password stores. I use passwordsafe to store my password in one place. If I do not have access to that place (PC) then I can't login. Bummer.Others use stores hosted on the Internet and those usually support most browsers and OSses through plugin/addons and non standard trickery.I never could convince myself to trust the providers.So. Drum-roll.I started to work on a mechanism that has a password store on the mobile which allows you to login on your PC using your PC's camera.The user story is as follows:browse to a site's login page e.g. my Firefox addon installed on the addon's iconpresent your credential-qrcode to the PC's camerabe logged inHere is an example qrcode containing the credentials as a JSON array["","password"]:The qrcode could be printed on paper or generated by your password store on your mobile. To help the user with the selection of the matching credentials the addon presents a request-qrcode to be read by the mobile first. This way the mobile ID-client can select the matching credentials. (If you don't like to install addons to test this and for a super quick demo of the qrcode reading using your webcam please to to and scan a code)What are the benefits?no need to change the site's javascript, html markup or https headers. No changes whatsoever needed on the accepting need to have an extra backend server to store your need to have an extra backend server to help mobile and browser to need for an enhanced browser or client. no need for the browser to know about new markup, new javascript APIs or HTTP headers.What are the drawbacks?reading the qrcode from the mobile's screen very much depends on the light and camera. Printed credentials work reliably but qrcode on mobile screens sometime give me headaches.You have to install the addon.This is an alpha version. Your mileage may vary. Screenshots:Login page at githup with addon installed:Screen after pressing the addon's toolbar icon. The qrcode helps the mobile ID-client to find the matching credentials:Screen showing the camera picture which is scanned for qrcodes:This is clearly only a first step but I believe that it has potential to be a true user-centric solution that helps me and you to handle the password mess.[...]

x-auto-login at Mozilla Services?


As I described here

Google is using a proprietary HTTP header named x-auto-login to log you into Google services like GMail using your local Android account.
This is cool.

Browse to a Google website and be logged in without the need to remember the super secure password. Sadly this is a closed system as we learned when implementing this for Firefox for Android (Fennec).

Yes, Fennec can talk to the Authenticator and ask for a "weblogin:" token for "" but the Authenticator answers differently depending on who asks. If Chrome is asking then the returned token redirects you to and immediately logs you in, but when you'r Fennec then you are just redirected to and have to enter username and password. Bummer.

Anyway: How about using this scheme for Mozilla services and using a Mozilla account on the device or local to the browser (Firefox Sync) if available.

  1. browse to e.g. (obviously a Mozilla service) and press the login button 
  2. get redirected to &ss=1&scc=1<mpl=bugzilla&emr=1 
  3. the response includes an x-auto-login HTTP header in the response 
  4. Firefox sees the x-auto-login header and
    - on desktop look for Firefox Sync account use it to obtain a token from a token endpoint hosted at
    - on Android ask the AccountManager for a weblogin token for "org.mozilla". 
  5. redirect to the token (the token is an URL). In this case e.g.
  6. validates the token and redirects back to
I think this is doable and would benefit the users of Mozilla services.

Next step then (there is always a next step) is to allow third party logins e.g. from githup to bugzilla using x-auto-login.


X-Auto-Login at Google


Below you can find evidence that Google is using the X-Auto-Login header in production.
Please see my other post for context:
 I am using "wget" to get gmail web page and the HTTP response contains the X-Auto-Login header.

I think that Google should standardize this.
Currently Google is using OpenID2 here but it is probably ease to standardize this with OpenID Connect.

ignisvulpis@namenlos:~/mozilla-central$ wget -S --user-agent="Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36"
--2014-11-03 12:23:50--
Connecting to connected.
Proxy request sent, awaiting response...
HTTP/1.1 302 Moved Temporarily
Content-Type: text/html; charset=UTF-8
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Date: Mon, 03 Nov 2014 11:23:51 GMT
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Alternate-Protocol: 443:quic,p=0.01
Connection: close
Location:<mpl=googlemail&emr=1 [following]
--2014-11-03 12:23:51--<mpl=googlemail&emr=1
Connecting to connected.
Proxy request sent, awaiting response...
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Strict-Transport-Security: max-age=10893354; includeSubDomains
Set-Cookie: GAPS=1:lAGQAL021CeF4UofSLjbzRnvJw_Eqw:256mW0v3ZoeLVjLo;Path=/;Expires=Wed, 02-Nov-2016 11:23:51 GMT;Secure;HttpOnly;Priority=HIGH
Set-Cookie: GALX=xATUIfBPIN4;Path=/;Secure
X-Frame-Options: DENY
Cache-control: no-cache, no-store
Pragma: no-cache
Expires: Mon, 01-Jan-1990 00:00:00 GMT
  Transfer-Encoding: chunked
Date: Mon, 03 Nov 2014 11:23:51 GMT
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Server: GSE
Alternate-Protocol: 443:quic,p=0.01
Connection: close
Length: unspecified [text/html]

2014-11-03 12:23:51 (1,44 MB/s) - ‘mail’ saved [70172]




Maybe you are an Android user and wondered how sometimes the browser logs you in without asking for a password?

Well, I wondered but never found the time to investigate.

Thanks to the awesome W3C Web Cryptography Next Steps Workshop and thanks to the usual jet-lag I found that time now. First I thought that this is Google-ism "Chrome does some questionable proprietary trick and knows just how to login to Google accounts". That is half-true.

There is chatter on the chromium list but I seems that the Android browser knows this trick since 2011 and Chrome for Android was released in 2012.

So how does it work?
  1. a site responds with a special HTTP header "X-Auto-Login" 
  2. the browser sees that header 
  3. the browser asks the device's account system for local accounts for the realm parameter of the header (e.g. 
  4. the browser asks for a special kind of token from that account 
  5. the browser asks the user for consent to login 
  6. the token is an URL - so if the user consents the browser opens that URL 
  7. the site the URL points to accepts the token 
  8. the site redirects the browser to the original page the user wants to use


I think this is neat. But why doesn't Google talk about it? Why isn't this standardized at W3C?
Anyway. How can you benefit?
As a user? You already do.
As a website with your own mobile app?
  1. Well, Google is probably not issuing tokens for your site. Maybe they do or would do because they want to be an identity provider?... 
  2. Issue the tokens yourself.
  1.  What you need on the Android device is an AccountAuthenticator. (image)  
  2. let your website issue the X-Auto-Login HTTP header "realm=com.yourdomain&args=..." 
  3. let your Account Authenticator from step a generate tokens based on 'String authTokenType="weblogin:" + args;' 
  4. let your site accept the tokens generated by your Account Authenticator

I think this is a good idea. If your company has an mobile app then build that Account Authenticator. This is even more true if your company has several mobile apps. (Put the authenticator in your own CompanyServices.apk (like Google does with the GooglePlayServices) so you can update independently from your apps.)

You might know that I work for a 100% subsidiary of Deutsche Telekom. Why isn't DT doing this? Don't ask me. I am telling them for years that our own AccountAuthenticator would be "gold". But who listens to me. Working for a big company has its challenges.

Back to wondering... How can we get this or something similar standardized through W3C?

Maybe I should write a blog post to make it more known. But then who reads this blog anyway. ;-)

Thanks for listening. (image)

Web Identity Restart?


Well, how can you restart something that never started? ... Never mind.

I am wondering whether it makes sense to have a W3C workshop on "Internet Identity" again.

My impression in 2011 was that the common ground was not very broad so the group decided to launch the W3C WebCrypto working group because all agreed that crypto is a precondition to web identity. Now, three years later I do not see much progress in web crypto or web identity (for that matter).

In the meantime the FIDO alliance was established which has HW-based authentication but a license model that requires that implementers are a FIDO alliance member. That is the opposite of a web standard.

So I think that the WebCrypto WG will not give us "identity for the web". Signing/verification/encryption/decryption are too low level and too easy to use wrong. This is not the way to web identity.

Maybe it is time to restart the web identity effort in W3C.(image)

ACM Digital Identity Management


The call for papers to ACM Digital Identity Management is open

"Identity at the Crossroads"

This workshop will explore crucial issues concerning interoperable identity management technologies for the information society.
Identity management has seen a series of development in the recent years. Whereas identity management and federation standards have been solidified and adopted in practice, nations world-wide are investing in electronic identity systems as strong root identities for their citizens offering a promise for strong authentication. Privacy-enhancing identity systems have reached some technical maturity and may offer user authentication with minimal disclosure. At the same time, personal identifiable information and the user's identity has become a commodity to drive the business of global corporations. Whereas such companies sought to bind the users accounts to their unique identity, there has been a reported unrest and anxiety of users because of their diminishing privacy protection.
We see identity at the crossroads. One possibility is the unique identification and strong authentication road that may offer increased trust for e-commerce and increasing cloud services. Another is the road of attribute exchange and leveraging the user's personal identifiable information that may benefit business and help users to have a consistent experience among many mobile compute platforms. Finally, there is the privacy-enhancing identity systems road that may offer additional protection for the user's civil rights. Partially these different roads seem to contradict each other. Research can offer roads less taken that overcome these seeming contradictions and come up with next generation identity solutions.

See you in Berlin in November! (image)

HTTPS EveryWhere Kantara Initiative


I noticed that when I am logged into and I then access documents
on there is no SSL protection. This is probably not good.

HTTPS Everywhere to the rescue!

I added my own rule to the HTTPS Everywhere Firefox addon. (Works in Firefox 21.0)



Put the above ruleset into the Firefox Profile folder into a file named e.g. kantarainitiative.xml.
On Windows it should be located in a folder similar to this location:
Now whenever I visit Kantara HTTPSEverywhere redirects Firefox to the SSL protected service.

Support EFF!


Android SSO


The documentation of Android's AccountManager is infamously uninformative. AccountManager is available since API level 5 and I got the impression that Google changed it a lot. I am not sure whether it is still work-in-progress. Probably.So how does Google do SSO for their own services? Not long ago Google introduced Google Play Services Google Play Services contains an Authenticator that handles all Accounts for "". The Google apps like GMail etc query this Authenticator for access tokens using the Authenticators getAuthToken method. The application can then use this access token to access the API of its backend server.How can this be secure? How does the Google Play Services SDK (GoogleAuthUtil) know that GMail is a trusted app?I am guessing here but I think that Google uses the same mechanism that Google recommends for developers. The keys used to sign an Android app are retrievable by the SDK and can be send to the backend. The backend then checks whether the keys match preconfigures keys.Of course this security has its limits. On a rooted phone or a custom build phone any app can claim to be the e.g. GMail app by replacing the Android library calls that fetch the signing keys. But then Google knows to which user (Google account) a phone is registered to. Maybe this can be used to inform the user that something is going on or the account can be inactivated. Difficult.(The new Google Play Developer Console helps.)I think this level of security is acceptable for most consumer cases.So let's say your company is a mobile games company (Acme Games) and you want SSO between your apps. Now write your own authenticator and put it into an apk e.g. "Acme Services".Now each of your games can query the existence of the Authenticator for your domain "com.acme".If it exists then ask for an access token. If it does not exist then the user has to prove to your backend that he knows something only he can know. (Successful login to a third party (e.g. Google+ Sign-In) or plain username and password). In this step you should recommend to install Acme Services because it helps the user to login to future games he will install. (And synchronization services, backup etc).It is a pity that not each game can contain an Authenticator. In fact it can but I have not tried it out. I do not know what happens if there are several Authenticators claiming to be authoritative for "". I guess this leads to trouble or else Google would chosen this way for their own apps.At least it takes up space in each of your app... That is the official reason given by Google:You're done! The system now recognizes your account type, right alongside all the big name account types like "Google" and "Corporate." You can use the Accounts & Sync Settings page to add an account, and apps that ask for accounts of your custom type will be able to enumerate and authenticate just as they would with any other account type.Of course, all of this assumes that your account service is actually installed on the device. If only one app will ever access the service, then this isn't a big deal—just bundle the service in the app. But if you want your account service to be used by more than one app, things get trickier. You don't want to bundle the service with all of your apps and have multiple copies of it taking up space on your user's device.One solution is to place the service in one small, special-purpose APK. When an app wishes to use your custom account type, it can check the device to see if your custom account service is available. If not, it can direct the user to Google Play to download the service. This may seem like a great deal of trouble at first, but compared with the alternative of re-entering credentials for every app that uses your custom account, it's refreshingly easy.It i[...]

Google: Standardizing Payments on the Web: Introducing requestAutocomplete()


Google is taking huge steps to simplify payments. Which is great!If you have about 25 minutes then watch this presentation. allowfullscreen="" frameborder="0" height="360" src="" width="640"> The major takeaways:Sites should use standardized names for form input field's autocomplete and name stay as they are but site owner should use standard values for autocomplete.WhatWGThe browser presents the user with a dialog that allows to choose between different sets of data; e.g. change to different shipping address. On Chrome there is tight integration with Google Wallet and instead of your real credit card information a one time credit card is issued by the Google Wallet backend.Caveat: Google Wallet currently is US only!Google Wallet is only one data source for autocomplete. If Google Wallet is not available then Chrome's local autofill  data is used for autocomplete.Google said that they talked to other browser vendors but that they could not talks about it right now... Mozilla's Ben Adida compares it to the geoLocation API. Although there is not official statement from Mozilla. Apple shows no reaction yet.Here is  a screenshot from the presentation showing sample HTML markup.The documentation is here.Well, this reminds me of our information card efforts.Microsoft - the inventor of information cards - took another approach then to integrate into the website. HTML5 was not really there in 2005. Microsoft suggested to use HTML object tags and the website could use the object's parameters to specify what attribute is needed. The Information Card foundation standardized the attribute names.We did some things differently than Google is doing now and maybe Information Cards where too secure and required too much change on the website. The most important difference between requestAutocomplete and the integration with Information Cards is that the data delivered to the site was a signed SAML token which could contain many more attributes about the user instead of only payment detail.Providing signed data is kind of a good thing because the site - the relying party - could immediately validate the signature and be sure that the attribute values are issued by a probably trusted issuer. (I won't go into self-issued cards here)Anyway, it seems the changes needed to be made to the site seemed to have been too big.Google's requestAutocomplete takes a smaller step. The user experience is probably similar if you compared requestAutocomplete and the information card selection. requestAutocomplete is a big step forward for the current web if it succeeds.The security improvements are not so big compared to information cards. The one time credit card feature is bound to Google Wallet and other browser vendors might not support Google Wallet. But this is probably not a show stopper. The security level of many current online payment schemes is in fact near zero. And requestAutocomplete is not going to change that.One thing that I would like to build. Support for requestAutocomplete through a wallet installed on the mobile phone.So Google's step forward is not as ambitious as the Information Card's one. But...Who cares if the overall completion rate sky rockets.[...]

Google Wallet Objects


During Google I/O there were several presentations about Google Wallet Objects.Although the documentation is not public one can get a few ideas what those objects are.What I find interesting is that we at T-Labs named the "things" inside our wallet "objects" too.Well, at first we just called them "cards" and the wallet is a card selector. The cards can be anything: payment cards, train tickets, loyalty cards, car keys, coupons. Everything that is in your wallet.Others called the "things" in the wallet "service". Some defined them just to be links to app on the same device as the wallet. Some defined them as meta data, that describes the service, the issuer, the service endpoints, the protocols needed to get tokens from the endpoints and so forth. Some objects contain code that is executed by the wallet.Our T-Labs wallet objects are currently called "items" and they are all of the above.They represent all the items in your wallet. It does not matter whether we call them items or objects.It does not matter (much) what the import format is: XML or JSON? Currently we are using an extended OASIS IMI format. In the extensions you can specify things like "app" for a wallet external  application that provides extra functions of an item. Or you can specify "AID" to tell the wallet which cardlet on the SIM the item uses/needs. What is important in Google's presentations is the ecosystem they are building around the wallet. Urban Airship, a Google Wallet Sandbox partner, has build a tool that makes it easy for wallet partners to create "objects". This is exactly what T-Labs demoed at the Cebit 2012 computer fair.It has to be easy for partners to build the wallet objects/items. Most partners should not have to care about the wallet object's format. It has to be easy to create and to deploy items to the wallet.I believe that the formats and protocols in the wallet ecosystem have to be open.I believe that the users should control the wallet objects: what item is in the wallet.Though I disagree with some of Google's decisions.Why keep the format and protocols kind of secret? Why the restrictions? I find it laughable to try to ban "abortion". Well, maybe it is not funny.It is the user's wallet. If they want a service then the wallet should not prevent it.Google controls the wallet. It is Google's wallet. It is not the user's wallet. #failWhy not the slightest hint to support online identity? Why not use e.g. your loyalty card or your club card to login into your favorite soccer club's fan site and online shop?Building the whole ecosystem at once is the right way. Calling the items "objects" is a nice coincident to my work.Interesting times...[...]



Oh no! I should never have agreed to that IoT WebSSO  thing.

Every time I revoke that diaper token I am immediately signed back in by the craddle.

FIDO Alliance


I am not happy with the FIDO Alliance and their FAQ do not eliminate my concerns.

The major concern beeing: "Why isn't this going straight to a standards body?"
Their answer:
The FIDO authentication protocol needs to be part of a standardized, interoperable ecosystem to be successful. Building this ecosystem requires the active commitment of everybody from hardware chipset vendors, to the manufacturers of back-end server systems. Coordination across the divergent interests of these players is a complex affair, and one that current technical standards bodies are not well suited to handle.
The FIDO Alliance will refine the protocol, and monitor the extensions required to meet market needs and to make the protocol robust and mature. Implementation will not be undertaken by the FIDO Alliance. The mature protocol will be presented to the IETF, W3C or similar body after which it will be open to all industry players to implement.
This is what standardization bodies working groups are for. Work on protocols and formats. Work on security considerations. Use the experience of "the community".

So FIDO is developing a protocol and will then present it to one standardization body...
Meanwhile it is a closed thing and it costs relevant amounts of money to join the alliance.
This neither free nor open.

During IIW there were several sessions on FIDO (1, 2). Each full of good intentions and marketing speek but no substance. No real information. You have to join the alliance to get that. Well, ...

Somebody at Nok Nok Labs convinced somebody at Paypal to hire them and found FIDO. Why Google joined despite Google's support for the W3C WebCrypto group I have no idea.

The W3C WebCrypto group is were this belongs. This might need rechartering of the group. But that is doable. Especially if the proposal is backed by a prototype implementation. Especially if it is backed by by Paypal, Lenovo, Google, Nxp and others.

I believe that we need better authentication methods beyond username and password. I think that bring your own (hardware) identiy might work to that goal. I believe that mobile phones, and SIM cards and NFC help to achieve this. I believe that the mobile wallet is the right user interface to choose your identity.

I believe that doing it in a closed group is not the right way.



Javascript API for OpenID


Too long ago I wrote about an Javascript API for openid: all those NASCARs

To repeat the main points:

Sites currently have no easy way to detect support for openid
The site can detect support for openid like so:

if (window.openid) { don't show the nascar }

The DOM level API that allows the site to query the preferred identity provider looks like this:

In a world of oauth2 and openid connect this could be generalized to:

var parameters = {};
parameters.request = "eyJhbGciOiJSUzI1NiIsIng1dSI6Imh0dHBzOlwvXC9nYWJ1bm9taS5uZXRcL3NlbWluYXJcL3JzYV9wdWJsaWNfa2V5LnBlbSJ9.ewoJInJlc3BvbnNlX3R5cGUiOiAiaWRfdG9rZW4iLAoJInNjb3BlIjogIm9wZW5pZCIsCgkiY2xpZW50X2lkIjogImh0dHBzOi8vZ2FidW5vbWkubmV0L3NlbWluYXIvY2FsbGJhY2suaHRtbCIsCgkicG9saWN5X3VybCI6ICJodHRwczovL2dhYnVub21pLm5ldC9zZW1pbmFyL3BvbGljeS5odG1sIiwKCSJ1c2VyaW5mbyI6IHsKCQkiY2xhaW1zIjogewoJCQkibmFtZSI6IG51bGwsCgkJCSJlbWFpbCI6IG51bGwsCgkJCSJwaWN0dXJlIjogbnVsbAoJCX0KCX0sCgkicmVnaXN0cmF0aW9uIjogewoJCSJhcHBsaWNhdGlvbl9uYW1lIjogIlNhbXBsZSBTZW1pbmFyIiwKCQkibG9nb191cmwiOiAiaHR0cHM6Ly9nYWJ1bm9taS5uZXQvc2VtaW5hci9sb2dvLnBuZyIsCgkJIng1MDlfdXJsIjogImh0dHBzOi8vZ2FidW5vbWkubmV0L3NlbWluYXIvcnNhX3B1YmxpY19rZXkucGVtIgoJfQp9Cg.Faytuhwb2W4CWVz2-10umSieh-bqR7QXqU0bNF39u_D0mGoBD4e3X2b4jZNqPvPADSnQhlBGSJu189iFM5bwFzchnO-quCpj7T2CK_-wkrpL5LUn_WHYMmYlFadmb-a1p-TEo7exU9azMS9cT70-kHNqmTaJziZyiAMoJ0Q4TtyTt1Xbkknc_CQRug3ilNv3bEXSlOlva3HUOY7jQIbYMB3jDL3QxS1wbVYNAjOxCxCDmiNAUJA-BkYe6Tpyj-DUs57IM4wQSp64sqim8RqirJJfFb4bCbNTkC3G8sYfN2_1-qEDpOnWW7N3gjl174TWHbnzVLAZGg_rZm58-wHOLw";

window.openid.connect(parameters, oc_callback);
The callback
would be called with one parameter.

function oc_callback(resp) {
// resp contains a signed then encrypted id_token in jw-* format
// state and nonce are inside the resp parameter too
// need a private key to decrypt it so forward it to my own validation endpoint
$.post("validate.php", { resp: resp },
function(id_token) {
alert("returned id_token: " + id_token);
The general idea is: put all http request parameters which are defined in openid connect into the request object. Put all the http respones parameters into the response object.

I think we need an Javascript API for identity that is supported by browsers. BrowserID/Persona and AccountChooser do something in this direction but not enough. (image)

ECDH-ES for JSON Web Encryption


The JSON WebToken spec RECOMMENDS that ECDH-ES is implemented. Here we go: Here are the relevant snippets from the JWA spec:4.1. "alg" (Algorithm) Header Parameter Values for JWE alg Parameter ValueKey Encryption or Agreement AlgorithmECDH-ESElliptic Curve Diffie-Hellman Ephemeral Static, as defined in RFC 6090 , and using the Concat KDF, as defined in Section 5.8.1 of NIST.800-56A, where the Digest Method is SHA-256 and all OtherInfo parameters are the empty bit string4.6. Key Agreement with Elliptic Curve Diffie-Hellman Ephemeral Static (ECDH-ES)This section defines the specifics of agreeing upon a JWE CMK with Elliptic Curve Diffie-Hellman Ephemeral Static, as defined in RFC 6090, and using the Concat KDF, as defined in Section 5.8.1 of NIST.800-56A, where the Digest Method is SHA-256 and all OtherInfo parameters are the empty bit string. The alg header parameter value ECDH-ES is used in this case. A key of size 160 bits or larger MUST be used for the Elliptic Curve keys used with this algorithm. The output of the Concat KDF MUST be a key of the same length as that used by the enc algorithm. An epk (ephemeral public key) value MUST only be used for a single key agreement transaction. Appendix B. Encryption Algorithm Identifier Cross-Reference AlgorithmJWEXML ENCJCAElliptic Curve Diffie-Hellman Ephemeral StaticECDH-ES could not find a Java implementation in JavaSE and the Bouncycastle library does not seem to have one neither. Bouncycastle does implement keyderivation functions but not the one from NIST.800-56A. Valuable input came from this webpage "Key Derivation Functions: How many KDFs are there?". Taking the Bouncycasle implementation and converting it into KDFconcat is easy and here it is: next thing needed are some keypairs for the JUNIT test cases. I generated them using openssl.openssl ecparam -out key1.pem -name secp256r1 -genkeyand displayed them using openssl ec -in key1.pem -textread EC keyPrivate-Key: (256 bit)priv: 07:2f:23:22:c0:e7:5e:0c:85:17:64:b4:21:81:99: 67:78:fd:22:59:2f:87:e5:d4:38:36:09:74:29:a1: c3:fcpub: 04:ed:3c:83:1b:f3:e1:05:9f:12:07:7f:4b:e4:fd: fe:90:55:73:d1:c6:76:45:b4:7d:48:64:ea:17:9d: de:99:86:a9:a6:ad:34:27:4a:80:fc:94:b3:a5:ef: 6c:6e:78:2c:22:7a:39:63:a6:a4:26:50:97:6d:a6: ad:e9:90:a1:61ASN1 OID: prime256v1writing EC key-----BEGIN EC PRIVATE KEY-----MHcCAQEEIAcvIyLA514MhRdktCGBmWd4/SJZL4fl1Dg2CXQpocP8oAoGCCqGSM49AwEHoUQDQgAE7TyDG/PhBZ8SB39L5P3+kFVz0cZ2RbR9SGTqF53emYappq00J0qA/JSzpe9sbngsIno5Y6akJlCXbaat6ZChYQ==-----END EC PRIVATE KEY-----Too bad that the man page does not go into detail in what format priv and pub are... Read the source, Luke! It seems that the priv key D is just the bytes in hex of the private key BigInteger. The public key seems to be something else but this is no problem because in ECC the public key is G*D where G is a curve parameter. So the two private keys are now defined here in the JUNIT tests. One is for the sender of the JWE the other for the recipient. static final String ec256_a_priv = "072f2322c0e75e0c851764b42181996778fd22592f87e5d43836097429a1c3fc"; static final String ec256_b_priv = "1a3eda89dc067871530601f934c6428574f837507c578e45bd10a29b2e019bfb";Now the public keys are computed like this: ASN1ObjectIdentifier oid = ECUtil.getNamedCurveOid("secp256r1"); X9ECParameters x9ECParameters = ECUtil.getNamedCurveByOid(oid); byte[] ec256_a_priv_bytes = Hex.decode(ec256_a_priv); ec256_a_D = new BigInteger(1, ec256_a_priv_bytes); ECPoint pub =[...]

Playing with Google's Identity Toolkit on


Today I retried Google's Identity Toolkit.
So I had to undust my rudimentary PHP knowledge and write some scripts and minimal html pages.

Clicking the key hole icon opens the account chooser.

I choose GMail and login to Google.

This is the result page. My site now knows some attributes about me like verifiedEmail, display name and imageUrl etc.

Next task: Repeat and rinse with

Debugging OAuth2 SSL Connections


Debugging SSL protected protocols like oauth2 can be a problem but it is not entirely impossible nor hard to do.

One way to do it is to spoof the certificates the protocol relies on to protect the communication. The certificates are used by the client to verify that the server is the endpoint it is supposed to be talking to and to encrypt the communication. A good description for the Android operating system is given in this blog post (Intercepting and decrypting SSL communications between Android phone and 3rd party server). Nobody can blame Android for being picked here as an example and ways to do this exist for all operating systems. Yes, to install the certs you need root access; but it well may be that you have that and want to help a friend to debug their installed application on your phone. Even if the client is running on a server it may be worthwhile to debug the network traffic to find certain errors in the client implementation. An error specific to an oauth implementation might be that your friend has a typo in the cliend_id or client_secret and the authorization server is rejecting requests because of that.
It might be hard for you to verify client_id and client_secret by analyzing the client. Maybe they are stored on a UICC or stored encrypted in the file system (and the keystore password is not "changeit") and are only decrypted and used when a resource owner uses the client.
By analyzing the SSL traffic you can help to find this kind of bug and all other related to protocol issues.

But maybe you don't have an SSL server to capture the plain text from an SSL connection?! Then another path you might take is to swap the client's SSL implementation with your own. You don't have to change the client's code or analyze the client's memory. Building your own version of most operating systems with your own SSL implementation is not that hard to do. Or maybe you can just register your SSL implementation to be used with all client code? Or you can swap a library?
There are more ways to achieve your goal.

But make sure that you have your friend's permission first. Not everybody might be happy with the fact that you now know the client_id and client_secret.

Have fun!


Identity Management @ RSA 2012 Europe


Sharpen your keyboard and submit a paper for the Identity Management track at RSA Conference Europe 2012. The leading conference on security and all things you need to know.

From the topic description: Identity Management
Identity Management covers issues of access control, authentication, identification technologies & protocols. Sessions on Identity and Access Management (IAM) fit here, along with sessions on IAM standards and architecture. This topic also covers issues such as credential management, multifactor authentication and new methods of authentication.
The Call for Speakers closes on Friday 18th May(image) unconfused


Here the unconfusing part with was censored in one other post about the same UI.

Note the Amazon favicon and URL.(image)

OpenID Connect Test Servers


Here are some experimental OpenID Connect server configurations: {  "version":"3.0",  "issuer":"",  "authorization_endpoint":"",  "token_endpoint":"",  "userinfo_endpoint":"",  "check_id_endpoint":"",  "registration_endpoint":"",  "scopes_supported":[    "openid",    "profile",    "email",    "address",    "PPID"  ],  "response_types_supported":[    "code",    "token",    "id_token",    "code token",    "code id_token",    "id_token token"  ],  "user_id_types_supported":[    "public",    "pairwise"  ],  "x509_url":""} {  "version":"3.0",  "issuer":"",  "authorization_endpoint":"",  "token_endpoint":"",  "user_info_endpoint":"",  "check_id_endpoint":"",  "registration_endpoint":"",  "scopes_supported":[    "openid",    "profile",    "email",    "address",    "PPID"  ],  "flows_supported":[    "code",    "token",    "code id_token",    "token id_token"  ],  "identifiers_supported":[    "public",    "ppid"  ]}{  "version":"3.0",  "issuer":"https:\/\/",  "authorization_endpoint":"https:\/\/\/abop\/op.php\/auth",  "token_endpoint":"https:\/\/\/abop\/op.php\/token",  "userinfo_endpoint":"https:\/\/\/abop\/op.php\/userinfo",  "check_id_endpoint":"https:\/\/\/abop\/op.php\/check_id",  "refresh_session_endpoint":"https:\/\/\/abop\/op.php\/refreshsession",  "end_session_endpoint":"https:\/\/\/abop\/op.php\/endsession",  "jwk_url":"https:\/\/\/connect4us.jwk",  "jwk_encryption_url":"https:\/\/\/connect4us.jwk",  "x509_url":"https:\/\/\/connect4us.pem",  "x509_encryption_url":"https:\/\/\/connect4us.pem",  "registration_endpoint":"https:\/\/\/abop\/op.php\/registration",  "scopes_supported":[    "openid",    "profile",&n[...] OpenID for Firefox Mobile Login


The version 1.2.1 of OpenID for Firefox Mobile works on more web pages .e.g. loginYou can either use the toolbar icon to start the OpenID flow OpenID for Firefox Mobile toolbar iconor you can use the page action to start the OpenID flow. OpenID for Firefox Mobile page actionGoogle Accounts account creation[...]

OpenID for Firefox Mobile Android


OpenID for Firefox is now available for Firefox Mobile (Fennec) on Android.This screenshot shows the OpenID icon in the toolbar. Tapping the icon inserts the preferred OpenID into the OpenID input field. The OpenID icon in the toolbarInstallation instructions:Browse to Addons@Mozilla and install the version 1.2 or newer:"OpenID for Firefox" at mozillaAdd to Firefox  Confirm the installation. Add-on installation dialogRestart the browser. Configure Firefox Sync to sync your OpenIDs from your desktop machine to your Android device. Browse to a site that supports OpenID. e.g.: The mobile version of OpenID for Firefox does not have all the nice features of the desktop version. You can not (yet) choose between OpenIDs when logging in. I needed a few evenings to adjust to the differences in addon development between the desktop and mobile versions of Firefox. But now I am confident that I can implement an account chooser for OpenIds on Firefox Mobile soon. [...]