Re: [OAUTH-WG] Report an authentication issue

John Bradley <> Thu, 28 June 2012 23:44 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 2F7CE21F8645 for <>; Thu, 28 Jun 2012 16:44:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -3.441
X-Spam-Status: No, score=-3.441 tagged_above=-999 required=5 tests=[AWL=0.157, BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-1]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id dHKfqkNZhZnc for <>; Thu, 28 Jun 2012 16:43:58 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 44C2521F8624 for <>; Thu, 28 Jun 2012 16:43:58 -0700 (PDT)
Received: by ghbg16 with SMTP id g16so2587409ghb.31 for <>; Thu, 28 Jun 2012 16:43:57 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to:x-mailer:x-gm-message-state; bh=y0aptBFSEmgQ4Hlf2YvkwSrqS7StaRZZjq2O1zmqNgs=; b=iU9XxgGRIXUYZDTZF0uTalRNnL5E9sr4WKaMhXQx3EPeRed6zUod8j9syGA9yG+vup YCA+RbBjkiHVAA84m+cMAY1xmNaXmoqzDYerf+or/xE4NKonGqpc+XX8iBO+r/3uRZTG cuVaOlc4ORq0yEKqznzuYxqbBkjytSj5siMzMxTpeyafDqggebQfF1yuxCQ6K91xz0wj jEEGLbNfdXqjJsB2vYAMEPR1zMu7pvMwJUdQk4fT0uSTHQz5DU6xY7Yx8wWiPOwLgsIO BGWVPZC709DzPUgOmJZQTPdfJSTbCuKX311G+xZzOLhJQhuyJiRGsKUmq5eHnJHVrfeL uT/w==
Received: by with SMTP id g3mr6369683yhn.59.1340927037660; Thu, 28 Jun 2012 16:43:57 -0700 (PDT)
Received: from [] ( []) by with ESMTPS id p14sm1003821ani.8.2012. (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Jun 2012 16:43:56 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1278)
Content-Type: multipart/signed; boundary="Apple-Mail=_8F802F55-481D-47F6-89B8-C3DE1E7310E0"; protocol="application/pkcs7-signature"; micalg="sha1"
From: John Bradley <>
In-Reply-To: <>
Date: Thu, 28 Jun 2012 19:43:47 -0400
Message-Id: <>
References: <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <CABzCy2DzmNgmMALNfc1qp95fwD2WULb-49Dk> <> <> <>
To: Lewis Adam-CAL022 <>
X-Mailer: Apple Mail (2.1278)
X-Gm-Message-State: ALoCoQkWaCx1tgtlezDkynALi/o2A32UEgkN3M0zdmXwRt7XjZq+Z3EWN+9/aYBR3MQzgyolYI17
Cc: "" <>
Subject: Re: [OAUTH-WG] Report an authentication issue
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: OAUTH WG <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Thu, 28 Jun 2012 23:44:00 -0000

Hi Adam,

I am working on an additional security concern around Authentication for the spec.

The OAuth spec is about protecting the "Protected Resource" in your case a video server.  
That is exactly what OAuth is intended to do.

The reason the term authorization is used is that the client can be a 3rd party web service,  a native app, or a JavaScript client in a user Agent.

In the case of the user granting a 3rd party service access to the video server via the same OAuth mechanism you probably would not say that the video server is authenticating the user as the user may well not be present.   The protected resource is validating that the 3rd party service has been delegated access by the user (resource owner) via the authorization server.

In the case where you have a client that by design is running on a device that is controlled by a single person and the person is authenticating themselves to the authorization server and granting the app access to the resource, you have crated a greatly constrained profile that is effectively the same as Authentication of the device holder to the resource.   You are however doing that by using a authorization mechanism and leveraging the constraints of your profile.

There are however places you can get into trouble if you don't have the correct profile and environment.

The Authentication that openID Connect, Facebook and others are doing is Authentication of the user to the client.   You see this in a native App like foursquare.

In that case I use Facebook's Authorization server (same apples to twitter) to identify myself to the app and give it access to push notifications.
I Authorize the App to access the Facebook graph API so it can get my name and other information, so In some sense I have Authenticated to it, and am logged in.
That is all well and good.

The problem comes in when the App passes the access token back to it's own servers and they assume that I am logged into the app and can let it post location information and get location history.
This all works perfectly fine, on the face of it.

The problem is that I also grant other clients access to my Facebook graph API and they have valid access tokens to get my information.

Any one of those sites that have access_tokens for my account can pass that to foursquare over the API they have for their client and get my information at foursquare.
(I believe forsquare is now using a proprietary Facebook API to validate that the token was issued to it's client_id to stop this attack now.)

All public clients are susceptible to this not just Apps.

The OAuth model works for you because you are using it the correct way to protect the resource.

Once you start using OAuth in ways not anticipated by the core spec, you need to consider the new attack surface.
Authenticating to the client is NOT safe with all of the flows unless additional security mechanisms are in place like the openID Connect id_token,  or facebooks introspection endpoint,
or facebooks's signed_request.   

There are ways that OAuth can be used safely for Authentication to the client but it requires profiling and extension.

My concern is that inexperienced people not use OAuth to create simple SSO flows with public clients, that are insecure for that purpose.

So Adam the bottom line is you are good to go because you are using OAuth as it is intended to be used.
You can call it Authentication if you like, but that authentication is based on a constrained profile of OAuth and tokens. It is a subset of the general Authorization mechanism.
While using JWT tokens brought to you by OpenID Connect may work as access tokens,  I don't see needing id_tokens or user_info endpoints.
There may be other applications that you develop in the future that might need them.

I hope that helps.
John B.

On 2012-06-28, at 6:34 PM, Lewis Adam-CAL022 wrote:

> Hi John,
> It may be semantics, but in my use cases, the AS is not “authorizing” anything.  It’s 1) authenticating the user, and 2) issuing a structured JWT access_token which contains claims about the user (again, just like the id_token, but as you said, aud=RS). 
> The video client on the iPhone/Android uses this as a bearer token, and includes it an a request to the video server.  The video server uses the claims in the JWT access_token to authenticate the user, and then makes its own authorization decisions (e.g. maps user id to app-centric roles, etc.)
> If you still feel this is within the spirit of OAuth, then great :-)
> My concern is still that one of our customer’s will read your blog and fire back at us … “but John says OAuth is not for authentication”  ;)
> This is why I would like to explore the idea of putting out an informational draft profiling OAuth for authentication, since everybody seems to at least agree that it can be profiled to do so.
> Tx!
> adam
> From: John Bradley [] 
> Sent: Thursday, June 28, 2012 3:48 PM
> To: Lewis Adam-CAL022
> Cc: Nat Sakimura;
> Subject: Re: [OAUTH-WG] Report an authentication issue
> Adam,
> This is getting tangled up in semantics.
> The AS authenticates the user and Authorizes the client (native App) to access the protected resource (video server) via issuing it a access token, or a authorization code that it can trade at a token endpoint for a refresh_token and access_token.
> At that point the client has no notion of who the user is unless a openID Connect id_token was also sent.  I suspect that the video player app may not care who the person, only what it can access.
> The App then uses its access token to prove that it was delegated access to the server by some person (Resource owner in OAuth speak).  
> In your STS example you call this Authentication, but in OAuth it is Authorization.  The client is the one being authenticated to the resource via the token.
> The User is Authenticated to the AS.   The same trust chain exists it just uses different terms.
> That token can be structured like the id_token is, but there is an important difference.  The access token's audience is the resource server and the id_token's audience is the client.
> That is one of the reasons they are separate.
> This looks like a relatively strait forward OAuth use case to me,  you can probably also use opaque tokens with a AS STS and some caching logic at the RS if you want to keep the token size down.
> John B.
> On 2012-06-28, at 4:13 PM, Lewis Adam-CAL022 wrote:
> Hi Nat,
> Starting from a standalone use case would be good. 
> My impression (I may be wrong) is that your requirement is to be able to 
> (1) Log the user identifier of the person who is accessing the resource at the resource server for the audit etc. purposes. 
> <acl> yes … that *and* to authenticate the user in the first place.  So again, my access_token will actually look like the Connect id_token.  I would even prefer to use the id_token, except that it violate the spirit of Connect to pass the id_token to the RS (e.g. it was only meant for consumption by the client).
> My problem space can be distilled to something very simple.  
> -          We come from a SOAP API world where we use WS-Trust to secure the SOAP API calls.  WS-Trust makes it very simple for a WS-* client to collect the user’s primary credentials, exchange it for a (SAML) bearer token via the STS, and embed that bearer token in SOAP-based API calls to the WS-* server. This is most definitely *authentication*
> -          We are moving to a RESTful API world.  I just want to be able to do the same thing as above. How do I enable my REST-based client to collect the user’s password, exchange it for a (JWT) bearer token via the STS, and embed that bearer token in RESTful API calls to the REST-based server, such that the REST-based server can *authenticate* the client?  
> (2) Do the holder of the key so that the RS is sure that the person accessing with the access token 
>      is really the person. 
> <acl> that would be nice, but most of my users will be using passwords in the beginning, so this is not an option.  I’m using the literal definition of bearer token here, taken straight out of the OAuth bearer token spec, e.g. “Any party in possession of a bearer token (a "bearer") can use it to get
> access to the associated resources (without demonstrating possession of a cryptographic key).”
> (3) In addition, the RS may not be able to talk to AS directly.
>      [Well, this is one of my use case anyways.] 
> <acl> Right … this is why I am now looking at structured JWTs.
> (4) In some cases, the client may not be able to communicate with AS directly at the time of RS access. [ditto]
> <acl> Right again, we have disaster scenarios to think about where the AS might not be reachable.  but this is a use case for next steps.  Trying to walk before we fly here :-)
> _______________________________________________
> OAuth mailing list