Subject: [OAUTH-WG] Fwd: issues with token age element - MAC token

From: Skylar Woodward <[email-masked]>
Date: Mon, 23 May 2011 18:16:46 -0700

Resending to the list from my subscribed account...

Begin forwarded message:

> From: Skylar Woodward <[email-masked]>
> Date: May 23, 2011 6:14:00 PM PDT
> To: Skylar Woodward <[email-masked]>
> Cc: Eran Hammer-Lahav <[email-masked]>, OAuth WG <[email-masked]>
> Subject: Re: [OAUTH-WG] issues with token age element - MAC token
> 
> So after discussing this today and reflecting on it a bit, I would suggest that nonce simply be the "unique value" (as it is so named) without further requirements. It might be suggested that this be composed of an random+timestamp (not age) value, but that seems more of a MAY or "recommended" practice. If the expectation is that very few if any providers would actually check the timestamp (or moreover, the nonce itself), why add terminology in the draft that requires it? Developers are doing extra housekeeping (and perhaps for a perceived benefit) but with no payoff or added security.
> 
> I'm sending this feedback based on having implemented the v3-5 changes last night (for both client credentials and requests w/ access tokens). After the changes, the nonce creation is now the most complicated part of the normalized request string and yet these changes offer the least benefit. What's most important is that nonces are unique on each request for an ID.
> 
> There are issues with age as well:
> 
> - As Bill mentioned, if the client stores the issue time based on receipt, then the internal clock changes (presumably w/o knowledge of the software storing the dates) then time will also fail. Assuming that a user with a bad clock (of by hours or more) will never fix it and actually encourages bad user behavior (don't fix your clock or Twitterbot will stop working!). Though we say that timezones won't bring about the situation of changed clock, I'd be to differ. Many users aren't savvy enough to change time zone, but just adjust the time to local time anyway. Users who are more likely to get it right already have auto clock sync enabled (via web, mobile, etc.)
> 
> - What if the token wasn't originally issued programmatically? In this case, the issue time has to be obtained from the server and stored on the client then you have the same problem as with a timestamp - the client clock is not sync'd to the server clock and there is no adjustment. You want this to apply to uses outside of just OAuth, but now requiring the client to be able to determine an issue time based on when it receives an HTTP request necessarily limits the types of token flows for which this can be used.
> 
> - It's one more detail to store. Hardly an issue for a developer, but it is inelegant. It's like having a double ID. Yet it's not an ID, it is actually more of a recording of "my personal clock offset value" but obfuscated several times over (one for each token) as issue_date.
> 
> - This implementation assumes software programs use the computer internal clock exclusively for timestamp. A robust program that is dependent on accurate timestamps would ping the origin server (or similar trusted time authority) to ask it the current time. Then it could store a "my device clock offset" value for the lifetime of the program execution. All requests needing timestamp would be adjusted accordingly. For age, if the clock is changed since the stored issue_date, the problem can't be corrected in this manner. Thus, a significant advantage for timestamp.
> 
> All in all, this seems like a misguided but well-intentioned attempt to get around end-user issues of mis-set clocks. It feels like a hack and it certainly isn't a foolproof solution. The more I think about the implications of the age parameter, the less I like it. Timestamp has been used for many years in the industry and with reasonable success in relevant applications. If we change to a new way of trying to sync on time I think we run a greater risk of stumbling upon unforeseen issues, such as those outlined above.
> 
> I recommend the requirement of an age (or timestamp for that matter) be dropped from the nonce construction. For providers that deem it valuable, timestamp can be an optional value (either as part of the nonce or the overall header, as before).
> 
> skylar
> 
> 
> 
> On May 23, 2011, at 2:11 AM, Skylar Woodward wrote:
> 
>> You may have noticed, on page 8 the host is listed as "example.net" - should be example.com, I believe.  (draft v5)
>> 
>> All in all, I'm in support of the changes in v2. Certainly addresses my hesitations from v2.
>> 
>> skylar
>> 
>> 
>> On May 9, 2011, at 12:36 PM, Eran Hammer-Lahav wrote:
>> 
>>> (Please discuss this draft on the Apps-Discuss <[email-masked]> mailing list)
>>> 
>>> http://tools.ietf.org/html/draft-hammer-oauth-v2-mac-token
>>> 
>>> While this document has moved to the Apps-Discuss mailing list for the time being, I wanted to give a quick update to those who have been following this draft which originated on this list.
>>> 
>>> The major changes since -02 are:
>>> 
>>> * Removed OAuth terminology and association. The draft is now a general purpose HTTP authentication scheme. It does include an OAuth 2.0 binding which is described in less than a page. One suggestion would be to move section 5.1 into the OAuth specification and drop all the OAuth 2.0 text from the MAC draft.
>>> 
>>> * Added 'Set-Cookie' extension for using MAC with session cookies.
>>> 
>>> * Removed request URI query normalization. The new draft uses the raw request URI unchanged.
>>> 
>>> * Replaced timestamps with credentials age to remove the need for clock sync.
>>> 
>>> * Added a placeholder for extension, allowing random text to be included in the request and MAC.
>>> 
>>> * Added issuer attribute for identifying the source of the credentials as an additional protection.
>>> 
>>> Draft -04 is not compatible with previous drafts.
>>> 
>>> EHL
>>> _______________________________________________
>>> OAuth mailing list
>>> [email-masked]
>>> https://www.ietf.org/mailman/listinfo/oauth
>> 
>

---

From: Peter Wolanin <[email-masked]>
Date: Sun, 29 May 2011 21:52:58 -0400

I am also concerned by the fragility of using
time-since-credentials-issued, and also the added complexity of
specifying this construction.

I think it would be preferable to always require a timestamp as part
of the authorization header, and maybe even include in the spec a
maximum time difference between client and server (e.g. 900 seconds)
that can be tolerated.  This makes generating the nonce easier also,
since the value need to longer be unique over all time.

We have such rules in place for an HMAC-based authentication system we
use.  Once in a while a client has a local clock so far out of sync
that there is an issue, but it's rare.

-Peter

-- 
Peter M. Wolanin, Ph.D.      : Momentum Specialist,  Acquia. Inc.
[email-masked] : 978-296-5247

"Get a free, hosted Drupal 7 site: http://www.drupalgardens.com"

---

From: Eran Hammer-Lahav <[email-masked]>
Date: Sun, 29 May 2011 22:54:57 -0700

Any kind of clock sync requirement for user-agents (basically, home desktops) it completely impractical. The added complexity pales in comparison to the difficulty of trying to use timestamps and any kind of clock sync. No window will be big enough as experience shows some users have closes that are off by more than an hour and a half.

The issue here is who is this being optimized for. Server-to-server communication should simply use TLS for privacy and MITM protection on top of MAC instead of using nonces to prevent replay. The whole point of this kind of replay protection is when TLS is not available.

I think a better approach is to simply make checking the nonce optional when TLS is used.

EHL

> -----Original Message-----
> From: [email-masked] [mailto:[email-masked]] On Behalf
> Of Peter Wolanin
> Sent: Sunday, May 29, 2011 6:53 PM
> To: Skylar Woodward
> Cc: OAuth WG
> Subject: Re: [OAUTH-WG] Fwd: issues with token age element - MAC token
> 
> I am also concerned by the fragility of using time-since-credentials-issued,
> and also the added complexity of specifying this construction.
> 
> I think it would be preferable to always require a timestamp as part of the
> authorization header, and maybe even include in the spec a maximum time
> difference between client and server (e.g. 900 seconds) that can be
> tolerated.  This makes generating the nonce easier also, since the value need
> to longer be unique over all time.
> 
> use.  Once in a while a client has a local clock so far out of sync that there is an
> issue, but it's rare.
> 
> -Peter
> 
> >> So after discussing this today and reflecting on it a bit, I would suggest that
> nonce simply be the "unique value" (as it is so named) without further
> requirements. It might be suggested that this be composed of an
> random+timestamp (not age) value, but that seems more of a MAY or
> "recommended" practice. If the expectation is that very few if any providers
> would actually check the timestamp (or moreover, the nonce itself), why add
> terminology in the draft that requires it? Developers are doing extra
> housekeeping (and perhaps for a perceived benefit) but with no payoff or
> added security.
> >>
> >> I'm sending this feedback based on having implemented the v3-5 changes
> last night (for both client credentials and requests w/ access tokens). After
> the changes, the nonce creation is now the most complicated part of the
> normalized request string and yet these changes offer the least benefit.
> What's most important is that nonces are unique on each request for an ID.
> >>
> >> - As Bill mentioned, if the client stores the issue time based on
> >> receipt, then the internal clock changes (presumably w/o knowledge of
> >> the software storing the dates) then time will also fail. Assuming
> >> that a user with a bad clock (of by hours or more) will never fix it
> >> and actually encourages bad user behavior (don't fix your clock or
> >> Twitterbot will stop working!). Though we say that timezones won't
> >> bring about the situation of changed clock, I'd be to differ. Many
> >> users aren't savvy enough to change time zone, but just adjust the
> >> time to local time anyway. Users who are more likely to get it right
> >> already have auto clock sync enabled (via web, mobile, etc.)
> >>
> >> - What if the token wasn't originally issued programmatically? In this case,
> the issue time has to be obtained from the server and stored on the client
> then you have the same problem as with a timestamp - the client clock is not
> sync'd to the server clock and there is no adjustment. You want this to apply
> to uses outside of just OAuth, but now requiring the client to be able to
> determine an issue time based on when it receives an HTTP request
> necessarily limits the types of token flows for which this can be used.
> >>
> >> - It's one more detail to store. Hardly an issue for a developer, but it is
> inelegant. It's like having a double ID. Yet it's not an ID, it is actually more of a
> recording of "my personal clock offset value" but obfuscated several times
> over (one for each token) as issue_date.
> >>
> >> - This implementation assumes software programs use the computer
> internal clock exclusively for timestamp. A robust program that is dependent
> on accurate timestamps would ping the origin server (or similar trusted time
> authority) to ask it the current time. Then it could store a "my device clock
> offset" value for the lifetime of the program execution. All requests needing
> timestamp would be adjusted accordingly. For age, if the clock is changed
> since the stored issue_date, the problem can't be corrected in this manner.
> Thus, a significant advantage for timestamp.
> >>
> >> All in all, this seems like a misguided but well-intentioned attempt to get
> around end-user issues of mis-set clocks. It feels like a hack and it certainly
> isn't a foolproof solution. The more I think about the implications of the age
> parameter, the less I like it. Timestamp has been used for many years in the
> industry and with reasonable success in relevant applications. If we change to
> a new way of trying to sync on time I think we run a greater risk of stumbling
> upon unforeseen issues, such as those outlined above.
> >>
> >> I recommend the requirement of an age (or timestamp for that matter)
> be dropped from the nonce construction. For providers that deem it
> valuable, timestamp can be an optional value (either as part of the nonce or
> the overall header, as before).
> >>
> >> skylar
> >>
> >>
> >>
> >>> You may have noticed, on page 8 the host is listed as "example.net"
> >>> - should be example.com, I believe.  (draft v5)
> >>>
> >>>> While this document has moved to the Apps-Discuss mailing list for the
> time being, I wanted to give a quick update to those who have been
> following this draft which originated on this list.
> >>>>
> >>>> * Removed OAuth terminology and association. The draft is now a
> general purpose HTTP authentication scheme. It does include an OAuth 2.0
> binding which is described in less than a page. One suggestion would be to
> move section 5.1 into the OAuth specification and drop all the OAuth 2.0 text
> from the MAC draft.
> >>>>

---

From: Skylar Woodward <[email-masked]>
Date: Mon, 30 May 2011 09:03:54 +0200

But see, now you are specializing the use of MAC token even more - now it's becoming a service mainly for user-agents on home desktops? This is further for the original goal of making MAC as flexible is possible. In this case you should change the spec name to MAC_TOKEN_FOR_BROWSER_COOKIE_REPLACEMENT_IN_AGENTS_LIKE_FIREFOX - or MTBCRLF for short.

Sarcasm aside, my point is that timestamp is just as good as your offset technique and is more: reliable, straightforward, flexible.

User agents that care about creating robust behavior for home desktops or mobiles (presumably of users and OS not yet sophisticated enough to check network time on their own) should be advised to do clock correction on their own (by pinging a time service) and trusting the device clock alone.

Please change the spec back to using timestamp rather than age.

I'd also like to hear a convincing argument from the Mozilla co-authors about why they think that age is more resilient than the above (I believe it is not) and further more why they would find the above unattractive or difficult to implement in a modern user-agent.

Thanks,
skylar

... -.- -.-- .-.. .- .-. — .-- --- --- -.. .-- .- .-. -.. — ... -.- -.-- .-.. .- .-. — .-- --- --- -.. .-- .- .-. -..
skylar woodward
Kiva Developer Program  /  build.kiva.org  /  @buildkiva

---

From: Adam Barth <[email-masked]>
Date: Mon, 30 May 2011 00:08:06 -0700

I can't speak for Mozilla, but I can tell you that many folks don't
have synchronized clocks, for a wide variety of reasons.  I guess I
don't really understand why you view age as problematic.  You
reference "fragility of using time-since-credentials-issued" but you
don't say what exactly is fragile about it.  There's nothing
particularly complex about age, especially when using the monotonic
clock provided by all modern operating systems.

Adam

---

From: Skylar Woodward <[email-masked]>
Date: Tue, 31 May 2011 08:19:18 +0200

I don't think you read my first message on the topic (or I wrote too much).

Age is fragile because if the clock changes between issue_date and the time of submission, it will fail. We know many people don't have synchronized clocks, but using age only solves this problem if two assumptions hold true:

1) the client is able to guess the issue_date the server is using based on the time the credential was issued
2) the client system clock doesn't change between issue date and submission time.

Timestamp has neither of these issues because the client can always inquire about network time and can effectively correct for inaccuracies in the device timekeeping system.

Regarding the first assumption, this fails when a token might be re-issued between devices. An example is that we use MAC token for the client credentials, which are issued when a developer registers an application. The client has no way of determining on its own when the value was actually issued (unless we communicate that on the developer website and force users to embed that with client_id, which adds usability issues of users copying and entering string date values correctly). The same is actually true for all of our OAuth access tokens because we reissue tokens to the same client_id if they were previously issued and are still valid. (The client would thus think the issue_date was now() when if fact it was the time of the first issue for client_id+scope+grantor_id). Thus, age is really just a convoluted way of trying to communicate the device system offset:

	local_offset = current_server_time - current_device_time
	age = current_device_time - (server_issue_date-local_offset)

Since the protocol doesn't currently allow for server_issue_date to be given with tokens, thus age currently can't have the resilience that timestamp does. It also forces servers to issue new tokens on demand just to make the convoluted age system work (rather than reuse existing valid tokens). Or, you have to modify the protocol to add server_issue_date and current_server_time into the token-issue exchange - eg, more complexity.

Timestamp is simpler, proven, it and it has a solution for your use case of unsyncronized clocks.

skylar

---

From: Adam Barth <[email-masked]>
Date: Tue, 31 May 2011 00:47:50 -0700

Timestamps don't work when the client doesn't have a synchronized
clock.  It's true that a client could synchronize its clock with the
network, but our implementation experience is that many clients don't
for a variety of reasons.  That means that age better because, you
know, it works.

Adam

---

From: Skylar Woodward <[email-masked]>
Date: Tue, 31 May 2011 10:04:00 +0200

It seems we're failing to communicate. Or you're not understanding my use cases. Age doesn't "just" work. It only works for a limited number of uses cases that must include all of yours - and it is brittle at that. It doesn't work for any of our uses cases (where the client can't know issue_date w/o the server telling it - in which case we have the equivalent problem as timestamp).

If you'd like to talk this out over Skype I'm happy to do that, so I can help you understand why age doesn't work.

---

From: Adam Barth <[email-masked]>
Date: Tue, 31 May 2011 01:30:44 -0700

I'm not sure we need a Skype call.  Can you explain the trouble caused
by age clearly?  I didn't understand your previous explanation.  The
more concrete you can be, the better.

Thanks,
Adam

---

From: Skylar Woodward <[email-masked]>
Date: Tue, 31 May 2011 10:46:44 +0200

First we should agree on a common understanding of the spec. The reason why age works with unsynchronized clocks is that the client determines issue_date based on the time when it receives the token over the wire. This depends on the server and client both recording time this way and for the transmission of the token to be be not longer than the margin of error for validating age. Are we agreed on this understanding?

The easiest case for me to explain here is client credentials because I have to assume you've built and registered a Twitter app at some point (or similar OAuth 1.0a app). You registered your app on the site and were issued a client_id and client_secret (called consumer_key and consumer_secret in 1.0). You then embedded these values in your client (they were not issued programmatically to your app). Assuming the MAC token algorithm is used then for establishing client identity (originally one of the uses we, the working group, hoped MAC would cover) how then will your client determine issue date?

After we can establish where you're at on the two above points I'll continue with the explanation. But as a preview, the next points would be:

- If issue_date comes form the server, how is it translated to the client?
- If you use a server provided issue_date, how do you then translate that a value relative to the local unsyncronized clock?
- If your answer to that is to also provide the current server time to the client so the offset on the server provided issue_date can be calculated what is the difference between all of these values and just using timestamp?

So don't get wrapped up in those 3 questions until we establish your contextual understanding of the first two paragraphs. Feel free to also respond to me off the list so we don't trouble everyone else with us getting on the same page (the reason, I thought, why a Skype call would be more efficient and painless). I do think my explainations all have been very clear thus far. There must be a contextual confusion that is keeping us from a common understanding of the terminology or the use cases.

skylar

---

From: Phil Hunt <[email-masked]>
Date: Tue, 31 May 2011 08:46:22 -0700

Skylar,

So your perspective is the issue-date calculations depend on client knowing the time of the server (not always true - hence the problem).

But that, "Age" assumes the client knows the receipt date of the token and that we are assuming transmission time is negligible compared to allowed age.

It seems that the latter would work for most cases with a moderate age times, but may not work at extremes such as where the transfer time of token is for some reason not reliable (e.g. because it is OOB), there are intermediaries, or where timelines are very tight in high security scenarios (the client must use token within seconds).

I can see valid use cases for both date and age. Is it possible to support both methods in the specification where selected at the discretion of the issuer?  I can't see a case where the server would want to give the option to a client regarding age vs. date. It seems to me the conditions of the resource server would determine what will be issued.

Phil

@independentid
www.independentid.com
[email-masked]

---

From: Eran Hammer-Lahav <[email-masked]>
Date: Tue, 31 May 2011 11:12:48 -0700

The client should calculate the time of issue based on when it gets the credentials. Network delays should be accounted for by the server when allowing shifts in the nonce itself.

EHL

> From: Skylar Woodward [mailto:[email-masked]]
> Sent: Tuesday, May 31, 2011 1:04 AM
> To: Adam Barth
> Cc: Eran Hammer-Lahav; OAuth WG
> It seems we're failing to communicate. Or you're not understanding my use
> cases. Age doesn't "just" work. It only works for a limited number of uses
> cases that must include all of yours - and it is brittle at that. It doesn't work
> for any of our uses cases (where the client can't know issue_date w/o the
> server telling it - in which case we have the equivalent problem as
> timestamp).
>
> >> Age is fragile because if the clock changes between issue_date and the
> time of submission, it will fail. We know many people don't have
> synchronized clocks, but using age only solves this problem if two
> assumptions hold true:
> >>
> >> 1) the client is able to guess the issue_date the server is using
> >> based on the time the credential was issued
> >> Timestamp has neither of these issues because the client can always
> inquire about network time and can effectively correct for inaccuracies in the
> device timekeeping system.
> >>
> >> Regarding the first assumption, this fails when a token might be re-issued
> between devices. An example is that we use MAC token for the client
> credentials, which are issued when a developer registers an application. The
> client has no way of determining on its own when the value was actually
> issued (unless we communicate that on the developer website and force
> users to embed that with client_id, which adds usability issues of users
> copying and entering string date values correctly). The same is actually true
> for all of our OAuth access tokens because we reissue tokens to the same
> client_id if they were previously issued and are still valid. (The client would
> thus think the issue_date was now() when if fact it was the time of the first
> issue for client_id+scope+grantor_id). Thus, age is really just a convoluted
> way of trying to communicate the device system offset:
> >>
> >> Since the protocol doesn't currently allow for server_issue_date to be
> given with tokens, thus age currently can't have the resilience that
> timestamp does. It also forces servers to issue new tokens on demand just
> to make the convoluted age system work (rather than reuse existing valid
> tokens). Or, you have to modify the protocol to add server_issue_date and
> current_server_time into the token-issue exchange - eg, more complexity.
> >>
> >>>> But see, now you are specializing the use of MAC token even more -
> now it's becoming a service mainly for user-agents on home desktops? This is
> further for the original goal of making MAC as flexible is possible. In this case
> you should change the spec name to
> MAC_TOKEN_FOR_BROWSER_COOKIE_REPLACEMENT_IN_AGENTS_LIKE_FI
> REFOX - or MTBCRLF for short.
> >>>>
> >>>> Sarcasm aside, my point is that timestamp is just as good as your offset
> technique and is more: reliable, straightforward, flexible.
> >>>>
> >>>> User agents that care about creating robust behavior for home
> desktops or mobiles (presumably of users and OS not yet sophisticated
> enough to check network time on their own) should be advised to do clock
> correction on their own (by pinging a time service) and trusting the device
> clock alone.
> >>>>
> >>>> I'd also like to hear a convincing argument from the Mozilla co-authors
> about why they think that age is more resilient than the above (I believe it is
> not) and further more why they would find the above unattractive or difficult
> to implement in a modern user-agent.
> >>>>
> >>>> Thanks,
> >>>> skylar
> >>>>
> >>>> ... -.- -.-- .-.. .- .-. - .-- --- --- -.. .-- .- .-. -.. - ... -.- -.-- .-.. .- .-. - .-- --- ---
> -.. .-- .- .-. -..
> >>>> skylar woodward
> >>>>> Any kind of clock sync requirement for user-agents (basically, home
> desktops) it completely impractical. The added complexity pales in
> comparison to the difficulty of trying to use timestamps and any kind of clock
> sync. No window will be big enough as experience shows some users have
> closes that are off by more than an hour and a half.
> >>>>>
> >>>>> The issue here is who is this being optimized for. Server-to-server
> communication should simply use TLS for privacy and MITM protection on
> top of MAC instead of using nonces to prevent replay. The whole point of
> this kind of replay protection is when TLS is not available.
> >>>>>
> >>>>>> From: [email-masked] [mailto:[email-masked]] On
> >>>>>> Behalf Of Peter Wolanin
> >>>>>> Subject: Re: [OAUTH-WG] Fwd: issues with token age element -
> MAC
> >>>>>> token
> >>>>>>
> >>>>>> I think it would be preferable to always require a timestamp as
> >>>>>> part of the authorization header, and maybe even include in the
> >>>>>> spec a maximum time difference between client and server (e.g.
> >>>>>> 900 seconds) that can be tolerated.  This makes generating the
> >>>>>> nonce easier also, since the value need to longer be unique over all
> time.
> >>>>>>
> >>>>>> We have such rules in place for an HMAC-based authentication
> >>>>>> system we use.  Once in a while a client has a local clock so far
> >>>>>> out of sync that there is an issue, but it's rare.
> >>>>>>
> >>>>>> -Peter
> >>>>>>
> >>>>>> On Mon, May 23, 2011 at 9:16 PM, Skylar Woodward
> >>>>>> <[email-masked]>
> >>>>>> wrote:
> >>>>>> nonce simply be the "unique value" (as it is so named) without
> >>>>>> further requirements. It might be suggested that this be composed
> >>>>>> of an
> >>>>>> "recommended" practice. If the expectation is that very few if
> >>>>>> any providers would actually check the timestamp (or moreover,
> >>>>>> the nonce itself), why add terminology in the draft that requires
> >>>>>> it? Developers are doing extra housekeeping (and perhaps for a
> >>>>>> perceived benefit) but with no payoff or added security.
> >>>>>>>>
> >>>>>> last night (for both client credentials and requests w/ access
> >>>>>> tokens). After the changes, the nonce creation is now the most
> >>>>>> complicated part of the normalized request string and yet these
> changes offer the least benefit.
> >>>>>>>> - As Bill mentioned, if the client stores the issue time based
> >>>>>>>> on receipt, then the internal clock changes (presumably w/o
> >>>>>>>> knowledge of the software storing the dates) then time will
> >>>>>>>> also fail. Assuming that a user with a bad clock (of by hours
> >>>>>>>> or more) will never fix it and actually encourages bad user
> >>>>>>>> behavior (don't fix your clock or Twitterbot will stop
> >>>>>>>> working!). Though we say that timezones won't bring about the
> >>>>>>>> situation of changed clock, I'd be to differ. Many users aren't
> >>>>>>>> savvy enough to change time zone, but just adjust the time to
> >>>>>>>> local time anyway. Users who are more likely to get it right
> >>>>>> the issue time has to be obtained from the server and stored on
> >>>>>> the client then you have the same problem as with a timestamp -
> >>>>>> the client clock is not sync'd to the server clock and there is
> >>>>>> no adjustment. You want this to apply to uses outside of just
> >>>>>> OAuth, but now requiring the client to be able to determine an
> >>>>>> issue time based on when it receives an HTTP request necessarily
> limits the types of token flows for which this can be used.
> >>>>>>>>
> >>>>>> inelegant. It's like having a double ID. Yet it's not an ID, it
> >>>>>> is actually more of a recording of "my personal clock offset
> >>>>>> value" but obfuscated several times over (one for each token) as
> issue_date.
> >>>>>>>>
> >>>>>> internal clock exclusively for timestamp. A robust program that
> >>>>>> is dependent on accurate timestamps would ping the origin server
> >>>>>> (or similar trusted time
> >>>>>> authority) to ask it the current time. Then it could store a "my
> >>>>>> device clock offset" value for the lifetime of the program
> >>>>>> execution. All requests needing timestamp would be adjusted
> >>>>>> accordingly. For age, if the clock is changed since the stored
> issue_date, the problem can't be corrected in this manner.
> >>>>>> around end-user issues of mis-set clocks. It feels like a hack
> >>>>>> and it certainly isn't a foolproof solution. The more I think
> >>>>>> about the implications of the age parameter, the less I like it.
> >>>>>> Timestamp has been used for many years in the industry and with
> >>>>>> reasonable success in relevant applications. If we change to a
> >>>>>> new way of trying to sync on time I think we run a greater risk of
> stumbling upon unforeseen issues, such as those outlined above.
> >>>>>>>>
> >>>>>> be dropped from the nonce construction. For providers that deem
> >>>>>> it valuable, timestamp can be an optional value (either as part
> >>>>>> of the nonce or the overall header, as before).
> >>>>>>>>
> >>>>>>>> skylar
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>> All in all, I'm in support of the changes in v2. Certainly
> >>>>>>>>> addresses my
> >>>>>> hesitations from v2.
> >>>>>>>>>
> >>>>>>>>> skylar
> >>>>>>>>>
> >>>>>>>>>
> >>>>>> time being, I wanted to give a quick update to those who have
> >>>>>> been following this draft which originated on this list.
> >>>>>>>>>>
> >>>>>>>>>> * Removed OAuth terminology and association. The draft is
> now
> >>>>>>>>>> a
> >>>>>> general purpose HTTP authentication scheme. It does include an
> >>>>>> OAuth 2.0 binding which is described in less than a page. One
> >>>>>> suggestion would be to move section 5.1 into the OAuth
> >>>>>> specification and drop all the OAuth 2.0 text from the MAC draft.
> >>>>>>>>>>
> >>>>>>>>>> * Removed request URI query normalization. The new draft
> uses
> >>>>>>>>>> the
> >>>>>> raw request URI unchanged.
> >>>>>>>>>>
> >>>>>>>>>> * Replaced timestamps with credentials age to remove the
> need
> >>>>>>>>>> for
> >>>>>> clock sync.
> >>>>>>>>>>
> >>>>>>>>>> * Added a placeholder for extension, allowing random text to
> >>>>>>>>>> be
> >>>>>> included in the request and MAC.
> >>>>>>>>>>
> >>>>>>>>>> * Added issuer attribute for identifying the source of the
> >>>>>>>>>> credentials as
> >>>>>> an additional protection.
> >>>>>>>>>>

---

From: "Freeman, Tim" <[email-masked]>
Date: Tue, 31 May 2011 18:19:39 +0000

>No window will be big enough as experience shows some users have [clocks] that are off by more than an hour and a half.

FWIW, I have seen users with clocks a year off (not at HP).  They set their clocks wrong so they could run expired beta software.  

Any requirement for synchronizing clocks will be actively circumvented, occasionally.

-----Original Message-----
From: [email-masked] [mailto:[email-masked]] On Behalf Of Eran Hammer-Lahav
Sent: Sunday, May 29, 2011 10:55 PM
To: Peter Wolanin; Skylar Woodward
Cc: OAuth WG
Subject: Re: [OAUTH-WG] Fwd: issues with token age element - MAC token

EHL

---

From: Igor Faynberg <[email-masked]>
Date: Tue, 31 May 2011 16:49:56 -0400

We have had a long discussion in the beginning on the OAuth analogies 
with Kerberos. I always thought that the topic of this thread is EXACTLY 
a case for import from Kerberos (which does rely on timestamps).  
Kerberos has been successfully deployed for a long time. But Kerberos 
has solved the problem of circumvention that Tim mentioned very simply: 
Those who circumvent clock synchronization won't be authenticated.

I actually thought that Skylar's proposal was in line with Kerberos.  I 
think it will be safe to import the appropriate procedures from (or 
refer to) Kerberos here.

To Eran's suggestion: Ensuring freshness of nonces is a non-trivial 
task, and I think it is much harder than clock synchronization.

Igor

Freeman, Tim wrote:
>>>>> All in all, I'm in support of the changes in v2. Certainly addresses my
>>>>>           
>> hesitations from v2.
>>     
>>>>> skylar
>>>>>
>>>>>
>>>>>> * Removed request URI query normalization. The new draft uses the
>>>>>>             
>>>>>> * Replaced timestamps with credentials age to remove the need for
>>>>>>             
>> clock sync.
>>     
>>>>>> * Added a placeholder for extension, allowing random text to be
>>>>>>             
>>>>>> * Added issuer attribute for identifying the source of the credentials as
>>>>>>

---

From: Mark Mcgloin <[email-masked]>
Date: Tue, 31 May 2011 21:58:21 +0100

Eran

Here are some additional sections to add to the next draft under security
considerations

CSRF
Cross-Site Request Forgery (CSRF) is a web-based attack whereby HTTP
requests are transmitted from a user that the website trusts or has
authenticated. CSRF attacks on OAuth approvals can allow an attacker to
obtain authorization to OAuth Protected Resources without the consent of
the User.
The state parameter should be used to mitigate against CSRF attacks,
particularly for login CSRF attacks. It is strongly RECOMMENDED that the
client sends the state parameter with authorization requests to the
authorization server. The authorization server will send it in the response
when redirecting the user to back to the client which SHOULD then validate
the state parameter matches on the response.

Clickjacking
Clickjacking is the process of tricking users into revealing confidential
information or taking control of their computer while clicking on seemingly
innocuous web pages. In more detail, a malicious site loads the target site
in a transparent iframe overlaid on top of a set of dummy buttons which are
carefully constructed to be placed directly under important buttons on the
target site. When a user clicks a visible button, they are actually
clicking a button (such as an "Authorize" button) on the hidden page.
To prevent clickjacking (and phishing attacks), native applications SHOULD
use external browsers instead of embedding browsers in an iFrame when
requesting end-user authorization. For newer browsers, avoidance of iFrames
can be enforced server side by using the X-FRAME-OPTION header. This header
can have two values, deny and sameorigin, which will block any framing or
framing by sites with a different origin, respectively. For older browsers,
javascript framebusting techniques can be used but may not be effective in
all browsers.

Regards
Mark

---

From: Adam Barth <[email-masked]>
Date: Tue, 31 May 2011 14:41:08 -0700

You haven't described a problem.

> First we should agree on a common understanding of the spec. The reason why age works with unsynchronized clocks is that the client determines issue_date based on the time when it receives the toke…

That's not correct.

The age allows the server to protect against replay attacks in bounded
memory.  With unbounded memory, the server can just remember every
nonce it has ever seen associated with a given key and reject replays.
 With bounded memory, the server eventually needs to evict some of
these nonces due to memory pressure.  The age value lets the server
reject the nonces with the smallest age values first.  The server then
rejects any messages with age values smaller than (or equal to) the
largest age value it has ever evicted for the given key.

Notice that neither clock synchronization nor transmission time plays
a role in that implementation.

> The easiest case for me to explain here is client credentials because I have to assume you've built and registered a Twitter app at some point (or similar OAuth 1.0a app). You registered your app o…

I recommend the date at which the developer obtained the credential
from Twitter because that is the date when the credential was issued.

> - If issue_date comes form the server, how is it translated to the client?

The issue_date does not come from the server.

> - If you use a server provided issue_date, how do you then translate that a value relative to the local unsyncronized clock?

The server does not provide the issue_date.

> - If your answer to that is to also provide the current server time to the client so the offset on the server provided issue_date can be calculated what is the difference between all of these value…

My answer is not to provide the current server time to the client.

Kind regards,
Adam

> So don't get wrapped up in those 3 questions until we establish your contextual understanding of the first two paragraphs. Feel free to also respond to me off the list so we don't trouble everyone else with us getting on the same page (the reason, I thought, why a Skype call would be more efficient and painless). I do think my explanations all have been very clear thus far. There must be a contextual confusion that is keeping us from a common understanding of the terminology or the use cases.
>
> skylar
>
>

---

From: Phil Hunt <[email-masked]>
Date: Tue, 31 May 2011 15:35:10 -0700

There seems to be a demonstrated need for both age and timestamp tokens.

The list has 2 separate cases with 2 separate proposals that do not solve all cases.

Can we at least agree that neither proposal works in all cases?

Phil

@independentid
www.independentid.com
[email-masked]

---

From: Adam Barth <[email-masked]>
Date: Tue, 31 May 2011 15:49:07 -0700

What use case isn't addressed by age?  No one has actually articulated it.

Adam

---

From: Igor Faynberg <[email-masked]>
Date: Tue, 31 May 2011 18:49:47 -0400

...Sorry to turn the question around so as to underline my pet peeve:  
Have we *documented* all cases?  (This is what the Use Cases document is 
supposed to be all about.)

Just to clarify: I am not arguing with Phil's point now. I just stress 
that as of this moment we don't have anything to check against.

Igor

---

From: "William J. Mills" <[email-masked]>
Date: Tue, 31 May 2011 16:17:44 -0700 (PDT)

http://tools.ietf.org/html/rfc6265#section-8.2 has good text on CSRF definition, which I think is clearer.  Perhaps that can be used to touch up your first paragraph?

________________________________
From: Mark Mcgloin <[email-masked]>
To: [email-masked]
Sent: Tuesday, May 31, 2011 1:58 PM
Subject: [OAUTH-WG] Draft 16 Security Considerations additions

Eran

CSRF

Clickjacking

Regards
Mark

---

From: Phil Hunt <[email-masked]>
Date: Tue, 31 May 2011 16:23:00 -0700

I think Skylar has made his case that age isn't sufficient for his needs.

Phil

@independentid
www.independentid.com
[email-masked]

On 2011-05-31, at 3:49 PM, Igor Faynberg wrote:

> ...Sorry to turn the question around so as to underline my pet peeve:  Have we *documented* all cases?  (This is what the Use Cases document is supposed to be all about.)
> 
> Just to clarify: I am not arguing with Phil's point now. I just stress that as of this moment we don't have anything to check against.
> 
> Igor
> 
> Phil Hunt wrote:

---

From: Adam Barth <[email-masked]>
Date: Tue, 31 May 2011 16:26:25 -0700

Really?  Can you point me to the email where he explains what the
actual problem is?

Adam

---

From: Eran Hammer-Lahav <[email-masked]>
Date: Tue, 31 May 2011 17:00:39 -0700

I think the use case document should focus on v2, not on MAC. At some point, it becomes impractical to keep every use case discussed on this list recorded.

EHL

> Of Igor Faynberg
> Sent: Tuesday, May 31, 2011 3:50 PM
> To: Phil Hunt
> Cc: OAuth WG
> Just to clarify: I am not arguing with Phil's point now. I just stress that as of
> this moment we don't have anything to check against.
>
> Igor
>
> Phil Hunt wrote:
> >>> First we should agree on a common understanding of the spec. The
> reason why age works with unsynchronized clocks is that the client
> determines issue_date based on the time when it receives the token over
> the wire. This depends on the server and client both recording time this way
> and for the transmission of the token to be be not longer than the margin of
> error for validating age. Are we agreed on this understanding?
> >>>
> >> That's not correct.
> >>
> >> The age allows the server to protect against replay attacks in
> >> bounded memory.  With unbounded memory, the server can just
> remember
> >> every nonce it has ever seen associated with a given key and reject
> replays.
> >> reject the nonces with the smallest age values first.  The server
> >> then rejects any messages with age values smaller than (or equal to)
> >> the largest age value it has ever evicted for the given key.
> >>
> >>> The easiest case for me to explain here is client credentials because I
> have to assume you've built and registered a Twitter app at some point (or
> similar OAuth 1.0a app). You registered your app on the site and were issued
> a client_id and client_secret (called consumer_key and consumer_secret in
> 1.0). You then embedded these values in your client (they were not issued
> programmatically to your app). Assuming the MAC token algorithm is used
> then for establishing client identity (originally one of the uses we, the
> working group, hoped MAC would cover) how then will your client
> determine issue date?
> >>>
> >>> After we can establish where you're at on the two above points I'll
> continue with the explanation. But as a preview, the next points would be:
> >>>
> >>> - If you use a server provided issue_date, how do you then translate
> that a value relative to the local unsyncronized clock?
> >>>
> >>> - If your answer to that is to also provide the current server time to the
> client so the offset on the server provided issue_date can be calculated what
> is the difference between all of these values and just using timestamp?
> >>>
> >>> So don't get wrapped up in those 3 questions until we establish your
> contextual understanding of the first two paragraphs. Feel free to also
> respond to me off the list so we don't trouble everyone else with us getting
> on the same page (the reason, I thought, why a Skype call would be more
> efficient and painless). I do think my explanations all have been very clear
> thus far. There must be a contextual confusion that is keeping us from a
> common understanding of the terminology or the use cases.
> >>>
> >>> skylar
> >>>
> >>>
> >>>> I'm not sure we need a Skype call.  Can you explain the trouble
> >>>> caused by age clearly?  I didn't understand your previous
> >>>> explanation.  The more concrete you can be, the better.
> >>>>
> >>>> Thanks,
> >>>> Adam
> >>>>
> >>>>
> >>>>> It seems we're failing to communicate. Or you're not understanding
> my use cases. Age doesn't "just" work. It only works for a limited number of
> uses cases that must include all of yours - and it is brittle at that. It doesn't
> work for any of our uses cases (where the client can't know issue_date w/o
> the server telling it - in which case we have the equivalent problem as
> timestamp).
> >>>>>
> >>>>> If you'd like to talk this out over Skype I'm happy to do that, so I can
> help you understand why age doesn't work.
> >>>>>
> >>>>>
> >>>>>
> >>>>>> clock.  It's true that a client could synchronize its clock with
> >>>>>> the network, but our implementation experience is that many
> >>>>>> clients don't for a variety of reasons.  That means that age
> >>>>>> better because, you know, it works.
> >>>>>>
> >>>>>> Adam
> >>>>>>
> >>>>>>
> >>>>>>> Age is fragile because if the clock changes between issue_date and
> the time of submission, it will fail. We know many people don't have
> >>>>>>> 1) the client is able to guess the issue_date the server is
> >>>>>>> using based on the time the credential was issued
> >>>>>>> Timestamp has neither of these issues because the client can
> always inquire about network time and can effectively correct for
> inaccuracies in the device timekeeping system.
> >>>>>>>
> >>>>>>> Regarding the first assumption, this fails when a token might be re-
> issued between devices. An example is that we use MAC token for the client
> >>>>>>> Since the protocol doesn't currently allow for server_issue_date to
> be given with tokens, thus age currently can't have the resilience that
> >>>>>>>> I can't speak for Mozilla, but I can tell you that many folks
> >>>>>>>> don't have synchronized clocks, for a wide variety of reasons.
> >>>>>>>> I guess I don't really understand why you view age as
> >>>>>>>> problematic.  You reference "fragility of using
> >>>>>>>> time-since-credentials-issued" but you don't say what exactly
> >>>>>>>> is fragile about it.  There's nothing particularly complex
> >>>>>>>> about age, especially when using the monotonic clock provided by
> all modern operating systems.
> >>>>>>>>
> >>>>>>>> Adam
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>> But see, now you are specializing the use of MAC token even
> more - now it's becoming a service mainly for user-agents on home
> desktops? This is further for the original goal of making MAC as flexible is
> possible. In this case you should change the spec name to
> >>>>>>>>> Sarcasm aside, my point is that timestamp is just as good as your
> offset technique and is more: reliable, straightforward, flexible.
> >>>>>>>>>
> >>>>>>>>> I'd also like to hear a convincing argument from the Mozilla co-
> authors about why they think that age is more resilient than the above (I
> believe it is not) and further more why they would find the above
> unattractive or difficult to implement in a modern user-agent.
> >>>>>>>>>
> >>>>>>>>> Thanks,
> >>>>>>>>> skylar
> >>>>>>>>>
> >>>>>>>>> ... -.- -.-- .-.. .- .-. - .-- --- --- -.. .-- .- .-. -.. - ... -.- -.-- .-.. .- .-. - .-
> - --- --- -.. .-- .- .-. -..
> >>>>>>>>> skylar woodward
> >>>>>>>>>> Any kind of clock sync requirement for user-agents (basically,
> home desktops) it completely impractical. The added complexity pales in
> >>>>>>>>>> The issue here is who is this being optimized for. Server-to-
> server communication should simply use TLS for privacy and MITM protection
> on top of MAC instead of using nonces to prevent replay. The whole point of
> >>>>>>>>>>> From: [email-masked] [mailto:oauth-
> [email-masked]]
> >>>>>>>>>>> On Behalf Of Peter Wolanin
> >>>>>>>>>>> MAC token
> >>>>>>>>>>> time-since-credentials-issued, and also the added complexity
> of specifying this construction.
> >>>>>>>>>>>
> >>>>>>>>>>> I think it would be preferable to always require a timestamp
> >>>>>>>>>>> as part of the authorization header, and maybe even include
> >>>>>>>>>>> in the spec a maximum time difference between client and
> >>>>>>>>>>> server (e.g. 900 seconds) that can be tolerated.  This makes
> >>>>>>>>>>> generating the nonce easier also, since the value need to
> longer be unique over all time.
> >>>>>>>>>>>
> >>>>>>>>>>> system we use.  Once in a while a client has a local clock
> >>>>>>>>>>> so far out of sync that there is an issue, but it's rare.
> >>>>>>>>>>>
> >>>>>>>>>>> -Peter
> >>>>>>>>>>>
> >>>>>>>>>>>>> Cc: Eran Hammer-Lahav <[email-masked]>, OAuth
> WG
> >>>>>>>>>>>>> <[email-masked]>
> >>>>>>>>>>> nonce simply be the "unique value" (as it is so named)
> >>>>>>>>>>> without further requirements. It might be suggested that
> >>>>>>>>>>> this be composed of an
> >>>>>>>>>>> random+timestamp (not age) value, but that seems more of a
> >>>>>>>>>>> random+MAY or
> >>>>>>>>>>> "recommended" practice. If the expectation is that very few
> >>>>>>>>>>> if any providers would actually check the timestamp (or
> >>>>>>>>>>> moreover, the nonce itself), why add terminology in the
> >>>>>>>>>>> draft that requires it? Developers are doing extra
> >>>>>>>>>>> housekeeping (and perhaps for a perceived benefit) but with
> no payoff or added security.
> >>>>>>>>>>>
> >>>>>>>>>>>>> I'm sending this feedback based on having implemented
> the
> >>>>>>>>>>>>> v3-5 changes
> >>>>>>>>>>>>>
> >>>>>>>>>>> last night (for both client credentials and requests w/
> >>>>>>>>>>> access tokens). After the changes, the nonce creation is now
> >>>>>>>>>>> the most complicated part of the normalized request string
> and yet these changes offer the least benefit.
> >>>>>>>>>>>>> - As Bill mentioned, if the client stores the issue time
> >>>>>>>>>>>>> based on receipt, then the internal clock changes
> >>>>>>>>>>>>> (presumably w/o knowledge of the software storing the
> >>>>>>>>>>>>> dates) then time will also fail. Assuming that a user with
> >>>>>>>>>>>>> a bad clock (of by hours or more) will never fix it and
> >>>>>>>>>>>>> actually encourages bad user behavior (don't fix your
> >>>>>>>>>>>>> clock or Twitterbot will stop working!). Though we say
> >>>>>>>>>>>>> that timezones won't bring about the situation of changed
> >>>>>>>>>>>>> clock, I'd be to differ. Many users aren't savvy enough to
> >>>>>>>>>>>>> change time zone, but just adjust the time to local time
> >>>>>>>>>>>>> anyway. Users who are more likely to get it right already
> >>>>>>>>>>>>> have auto clock sync enabled (via web, mobile, etc.)
> >>>>>>>>>>>>>
> >>>>>>>>>>> the issue time has to be obtained from the server and stored
> >>>>>>>>>>> on the client then you have the same problem as with a
> >>>>>>>>>>> timestamp - the client clock is not sync'd to the server
> >>>>>>>>>>> clock and there is no adjustment. You want this to apply to
> >>>>>>>>>>> uses outside of just OAuth, but now requiring the client to
> >>>>>>>>>>> be able to determine an issue time based on when it receives
> an HTTP request necessarily limits the types of token flows for which this can
> be used.
> >>>>>>>>>>>
> >>>>>>>>>>> inelegant. It's like having a double ID. Yet it's not an ID,
> >>>>>>>>>>> it is actually more of a recording of "my personal clock
> >>>>>>>>>>> offset value" but obfuscated several times over (one for each
> token) as issue_date.
> >>>>>>>>>>>
> >>>>>>>>>>> internal clock exclusively for timestamp. A robust program
> >>>>>>>>>>> that is dependent on accurate timestamps would ping the
> >>>>>>>>>>> origin server (or similar trusted time
> >>>>>>>>>>> authority) to ask it the current time. Then it could store a
> >>>>>>>>>>> "my device clock offset" value for the lifetime of the
> >>>>>>>>>>> program execution. All requests needing timestamp would be
> >>>>>>>>>>> adjusted accordingly. For age, if the clock is changed since the
> stored issue_date, the problem can't be corrected in this manner.
> >>>>>>>>>>> around end-user issues of mis-set clocks. It feels like a
> >>>>>>>>>>> hack and it certainly isn't a foolproof solution. The more I
> >>>>>>>>>>> think about the implications of the age parameter, the less
> >>>>>>>>>>> I like it. Timestamp has been used for many years in the
> >>>>>>>>>>> industry and with reasonable success in relevant
> >>>>>>>>>>> applications. If we change to a new way of trying to sync on
> time I think we run a greater risk of stumbling upon unforeseen issues, such
> as those outlined above.
> >>>>>>>>>>>
> >>>>>>>>>>> be dropped from the nonce construction. For providers that
> >>>>>>>>>>> deem it valuable, timestamp can be an optional value (either
> >>>>>>>>>>> as part of the nonce or the overall header, as before).
> >>>>>>>>>>>
> >>>>>>>>>>>>> skylar
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>>> http://tools.ietf.org/html/draft-hammer-oauth-v2-mac-
> tok
> >>>>>>>>>>>>>>> en
> >>>>>>>>>>>>>>>
> >>>>>>>>>>> time being, I wanted to give a quick update to those who
> >>>>>>>>>>> have been following this draft which originated on this list.
> >>>>>>>>>>>
> >>>>>>>>>>>>>>> * Removed OAuth terminology and association. The
> draft
> >>>>>>>>>>>>>>> is now a
> >>>>>>>>>>>>>>>
> >>>>>>>>>>> general purpose HTTP authentication scheme. It does include
> >>>>>>>>>>> an OAuth 2.0 binding which is described in less than a page.
> >>>>>>>>>>> One suggestion would be to move section 5.1 into the OAuth
> >>>>>>>>>>>>>>> uses the
> >>>>>>>>>>>>>>> need for

---

From: Eran Hammer-Lahav <[email-masked]>
Date: Tue, 31 May 2011 17:07:36 -0700

Adam and I have discussed a proposal which should address everyone's use cases. I will post shortly. Just FYI so people don't invest too much time in this thread...

EHL

> Of Phil Hunt
> Sent: Tuesday, May 31, 2011 3:35 PM
> To: Adam Barth
> Cc: OAuth WG
> >> The easiest case for me to explain here is client credentials because I have
> to assume you've built and registered a Twitter app at some point (or similar
> OAuth 1.0a app). You registered your app on the site and were issued a
> client_id and client_secret (called consumer_key and consumer_secret in
> >> - If you use a server provided issue_date, how do you then translate that
> a value relative to the local unsyncronized clock?
> >
> >>>> It seems we're failing to communicate. Or you're not understanding my
> use cases. Age doesn't "just" work. It only works for a limited number of uses
> >>>>>>> time-since-credentials-issued" but you don't say what exactly is
> >>>>>>> fragile about it.  There's nothing particularly complex about
> >>>>>>> age, especially when using the monotonic clock provided by all
> modern operating systems.
> >>>>>>>
> >>>>>>> Adam
> >>>>>>>
> >>>>>>>
> >>>>>>>> ... -.- -.-- .-.. .- .-. - .-- --- --- -.. .-- .- .-. -.. - ... -.- -.-- .-.. .- .-. - .--
> --- --- -.. .-- .- .-. -..
> >>>>>>>> skylar woodward
> >>>>>>>>>> system we use.  Once in a while a client has a local clock so
> >>>>>>>>>> far out of sync that there is an issue, but it's rare.
> >>>>>>>>>>
> >>>>>>>>>> -Peter
> >>>>>>>>>>
> >>>>>>>>>>>> Subject: Re: [OAUTH-WG] issues with token age element -
> MAC
> >>>>>>>>>>>> token
> >>>>>>>>>>>>
> >>>>>>>>>> without further requirements. It might be suggested that this
> >>>>>>>>>> be composed of an
> >>>>>>>>>> moreover, the nonce itself), why add terminology in the draft
> >>>>>>>>>> that requires it? Developers are doing extra housekeeping
> >>>>>>>>>> (and perhaps for a perceived benefit) but with no payoff or
> added security.
> >>>>>>>>>>>>
> >>>>>>>>>> the most complicated part of the normalized request string and
> yet these changes offer the least benefit.
> >>>>>>>>>>>> actually encourages bad user behavior (don't fix your clock
> >>>>>>>>>>>> or Twitterbot will stop working!). Though we say that
> >>>>>>>>>>>> timezones won't bring about the situation of changed clock,
> >>>>>>>>>>>> I'd be to differ. Many users aren't savvy enough to change
> >>>>>>>>>>>> time zone, but just adjust the time to local time anyway.
> >>>>>>>>>>>> Users who are more likely to get it right already have auto
> >>>>>>>>>>>> clock sync enabled (via web, mobile, etc.)
> >>>>>>>>>>>>
> >>>>>>>>>> think about the implications of the age parameter, the less I
> >>>>>>>>>> like it. Timestamp has been used for many years in the
> toke
> >>>>>>>>>>>>>> n
> >>>>>>>>>>>>>> While this document has moved to the Apps-Discuss
> mailing
> >>>>>>>>>>>>>> list for the
> >>>>>>>>>>>>>> now a
> >>>>>>>>>>>>>> * Added a placeholder for extension, allowing random
> text
> >>>>>>>>>>>>>> to be

---

From: Igor Faynberg <[email-masked]>
Date: Tue, 31 May 2011 21:15:05 -0400

Maybe...  But this information must be captured somewhere, right?

At the moment, there seems to be no record of and consequently no 
reference point to the use case in question. And this is what has 
created all this discussion--with messages coming from all directions.

Igor

Eran Hammer-Lahav wrote:
>>> There seems to be a demonstrated need for both age and timestamp
>>>       
>> tokens.
>>     
>>> The list has 2 separate cases with 2 separate proposals that do not solve all
>>>       
>> cases.
>>     
>>>> On Tue, May 31, 2011 at 1:46 AM, Skylar Woodward <[email-masked]>
>>>>         
>> wrote:
>>     
>>>>>> On Tue, May 31, 2011 at 1:04 AM, Skylar Woodward <[email-masked]>
>>>>>>             
>> wrote:
>>     
>>>>>>>> On Mon, May 30, 2011 at 11:19 PM, Skylar Woodward
>>>>>>>>                 
>> <[email-masked]> wrote:
>>     
>>>>>>>>> I don't think you read my first message on the topic (or I wrote too
>>>>>>>>>                   
>> much).
>>     
>>>>>>>>> 2) the client system clock doesn't change between issue date and
>>>>>>>>>                   
>> submission time.
>>     
>>>>>>>>> Timestamp is simpler, proven, it and it has a solution for your use
>>>>>>>>>                   
>> case of unsyncronized clocks.
>>     
>>>>>>>>> skylar
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> On Mon, May 30, 2011 at 12:03 AM, Skylar Woodward
>>>>>>>>>>                     
>> <[email-masked]> wrote:
>>     
>>>>>>>>>>>> I think a better approach is to simply make checking the nonce
>>>>>>>>>>>>                         
>> optional when TLS is used.
>>     
>>>>>>>>>>>> EHL
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>                         
>>>>>>>>>>>>> Subject: Re: [OAUTH-WG] Fwd: issues with token age
>>>>>>>>>>>>>                           
>> element -
>>     
>>>>>>>>>>>>> MAC token
>>>>>>>>>>>>>
>>>>>>>>>>>>> We have such rules in place for an HMAC-based
>>>>>>>>>>>>>                           
>> authentication
>>     
>>>>>>>>>>>>> What's most important is that nonces are unique on each
>>>>>>>>>>>>>                           
>> request for an ID.
>>     
>>>>>>>>>>>>>>>> You may have noticed, on page 8 the host is listed as
>>>>>>>>>>>>>>>>                                 
>> "example.net"
>>     
>>>>>>>>>>>>>>>>> mailing list for the
>>>>>>>>>>>>> specification and drop all the OAuth 2.0 text from the MAC
>>>>>>>>>>>>>                           
>> draft.
>>     
>>>>>>>>>>>>>>>>> * Added 'Set-Cookie' extension for using MAC with
>>>>>>>>>>>>>>>>>                                   
>> session cookies.
>>     
>>>>>>>>>>>>>>>>> * Removed request URI query normalization. The new
>>>>>>>>>>>>>>>>>                                   
>> draft
>>     
>>>>>>>>>>>>>>>>> uses the
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>                                   
>>>>>>>>>>>>>>>>> * Replaced timestamps with credentials age to remove
>>>>>>>>>>>>>>>>>                                   
>> the
>>     
>>>>>>>>>>>>>>>>> need for
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>                                   
>>>>>>>>>>>>> clock sync.
>>>>>>>>>>>>>
>>>>>>>>>>>>>                           
>>>>>>>>>>>>>>>>> text to be
>>>>>>>>>>>>> Peter M. Wolanin, Ph.D.      : Momentum Specialist,  Acquia.
>>>>>>>>>>>>>                           
>> Inc.
>>     
>>>>>>>>>>>>> "Get a free, hosted Drupal 7 site:
>>>>>>>>>>>>>                           
>> http://www.drupalgardens.com"
>>

---

From: Skylar Woodward <[email-masked]>
Date: Wed, 1 Jun 2011 07:13:38 +0200

Yes, but I think my case is very important (eg, being able to use a MAC token as a client credential). I don't understand why Adam can't comprehend my explanation. My best guess is this is some kind of political game on his front to protect the age specification yet I don't understand any motivation for being so close-minded. His reply to my last thread was completely disrespectful and ignorant. Unless I've made him mad or offended him in some way I see no excuse for this behavior.

I'm going to make one more attempt to try to explain this to him over email. After that I recommend a Skype call (hopefully brief) or I will work offline with Eran to see if we can find some solution.

Btw, in addition to the use case of using MAC tokens for client credentials, we also have the use case of re-issuing a valid token multiple times to instances of the same client. (eg, the value of ID and secret are constant across multiple transmissions to client instances).

Thanks,
skylar

---

From: Skylar Woodward <[email-masked]>
Date: Wed, 1 Jun 2011 07:54:08 +0200

> You haven't described a problem.

Maybe so, but I guess you can't see yet where this is going, or you are ignoring it intentionally. I did preface this letter that I wanted to understand your perspective on this two points before attempting to continue the discussion. Let's try to move forward with your answer to the second question.

> a role in that implementation.

Yes, but this isn't a implementation we've yet considered and it isn't the one suggested by the spec. The spec states:

"To avoid the need to retain an infinite number of nonce values
         for future checks, the server MAY choose to restrict the time
         period after which a request with an old age is rejected."

This text is analogous to the text originally used for timestamp in which case "old" is relative to current time. By this text, I also understand age to be relative to the current time of the device constructing or validating the value. If "old" means relative to previous values seen by the server then the this text should be made more clear.

However, if this how you expect age to be used to invalidate old nonce history then timestamp is much simpler. The client can use any value so long as it makes sure that subsequent values come after previous values. It can keep a counter going from 0 upwards, or it can use some upward moving counter relative to its device (eg local clock). In fact, this is the more common definition used by most protocols using a timestamp. It is often merely a suggestion that current time be used for this value to avoid extra record-keeping on the part of the client. So if this is your intent you can simplify the specification of "age" by suggesting the client pick an arbitrary start point, but make no mention of it needing to be within a proximity of the server's understanding of the same start point.

Unfortunately though, this implementation doesn't help my use cases because such sequential requirement of a timestamp/age requires all devices with the token to be in sync as to the value of timestamp/age. So let's move on.

> from Twitter because that is the date when the credential was issued.

Okay, so this value was issued from the server to a developer account, not directly to the client software. How do you then propose the time is communicated to the client software program in a way where the date of issuance is relative to the clock on that device (not to the device holding the developer account data). For example, if the client credential was issued at time 2120 but is then installed with a client program on a device who thinks the current time is 630 then age is already negative (2120-630). How to translate 2120 from the date the developer obtained the credential to the translation of that date on a user device where the clock is significantly behind that of the developer services server (eg, dev.twitter.com) or even that of the local developer's box?

skylar

---

From: Eran Hammer-Lahav <[email-masked]>
Date: Tue, 31 May 2011 22:54:22 -0700

They are coming in 2-3 directions, the use case isn't really clear (other than claims of some flavors being harder than others), and overall this is more about general HTTP authentication than OAuth use cases. Don't get me wrong - if you want to put the effort in to capture these, go ahead. I just think this isn't worth the effort in a formal document.

EHL

> From: Igor Faynberg [mailto:[email-masked]]
> Sent: Tuesday, May 31, 2011 6:15 PM
> To: Eran Hammer-Lahav
> Cc: Phil Hunt; OAuth WG
> reference point to the use case in question. And this is what has created all
> this discussion--with messages coming from all directions.
>
> Igor
>
> Eran Hammer-Lahav wrote:
> > I think the use case document should focus on v2, not on MAC. At some
> point, it becomes impractical to keep every use case discussed on this list
> recorded.
> >
> > EHL
> >
> >
> >> Behalf Of Igor Faynberg
> >> Have we *documented* all cases?  (This is what the Use Cases document
> >> is supposed to be all about.)
> >>
> >> Just to clarify: I am not arguing with Phil's point now. I just
> >> stress that as of this moment we don't have anything to check against.
> >>
> >> Igor
> >>
> >> Phil Hunt wrote:
> >>
> >> determines issue_date based on the time when it receives the token
> >> over the wire. This depends on the server and client both recording
> >> time this way and for the transmission of the token to be be not
> >> longer than the margin of error for validating age. Are we agreed on this
> understanding?
> >>
> >>>> That's not correct.
> >>>>
> >>>> then rejects any messages with age values smaller than (or equal
> >>>> to) the largest age value it has ever evicted for the given key.
> >>>>
> >>>> Notice that neither clock synchronization nor transmission time
> >>>> plays a role in that implementation.
> >>>>
> >>>>
> >>>>
> >> have to assume you've built and registered a Twitter app at some
> >> point (or similar OAuth 1.0a app). You registered your app on the
> >> site and were issued a client_id and client_secret (called
> >> consumer_key and consumer_secret in 1.0). You then embedded these
> >> values in your client (they were not issued programmatically to your
> >> app). Assuming the MAC token algorithm is used then for establishing
> >> client identity (originally one of the uses we, the working group,
> >> hoped MAC would cover) how then will your client determine issue date?
> >>
> >> client so the offset on the server provided issue_date can be
> >> calculated what is the difference between all of these values and just
> using timestamp?
> >>
> >> contextual understanding of the first two paragraphs. Feel free to
> >> also respond to me off the list so we don't trouble everyone else
> >> with us getting on the same page (the reason, I thought, why a Skype
> >> call would be more efficient and painless). I do think my
> >> explanations all have been very clear thus far. There must be a
> >> contextual confusion that is keeping us from a common understanding of
> the terminology or the use cases.
> >>
> >>>>> skylar
> >>>>>
> >>>>>
> >> my use cases. Age doesn't "just" work. It only works for a limited
> >> number of uses cases that must include all of yours - and it is
> >> brittle at that. It doesn't work for any of our uses cases (where the
> >> client can't know issue_date w/o the server telling it - in which
> >> case we have the equivalent problem as timestamp).
> >>
> >>>>>>>> Timestamps don't work when the client doesn't have a
> >>>>>>>> synchronized clock.  It's true that a client could synchronize
> >>>>>>>> its clock with the network, but our implementation experience
> >>>>>>>> is that many clients don't for a variety of reasons.  That
> >>>>>>>> means that age better because, you know, it works.
> >>>>>>>>
> >>>>>>>> Adam
> >>>>>>>>
> >>>>>>>>
> >> issued between devices. An example is that we use MAC token for the
> >> client credentials, which are issued when a developer registers an
> >> application. The client has no way of determining on its own when the
> >> value was actually issued (unless we communicate that on the
> >> developer website and force users to embed that with client_id, which
> >> adds usability issues of users copying and entering string date
> >> values correctly). The same is actually true for all of our OAuth
> >> access tokens because we reissue tokens to the same client_id if they
> >> were previously issued and are still valid. (The client would thus
> >> think the issue_date was now() when if fact it was the time of the
> >> first issue for client_id+scope+grantor_id). Thus, age is really just a
> convoluted way of trying to communicate the device system offset:
> >>
> >> be given with tokens, thus age currently can't have the resilience
> >> that timestamp does. It also forces servers to issue new tokens on
> >> demand just to make the convoluted age system work (rather than reuse
> >> existing valid tokens). Or, you have to modify the protocol to add
> >> server_issue_date and current_server_time into the token-issue
> exchange - eg, more complexity.
> >>
> >> desktops? This is further for the original goal of making MAC as
> >> flexible is possible. In this case you should change the spec name to
> >>
> >> enough to check network time on their own) should be advised to do
> >> clock correction on their own (by pinging a time service) and
> >> trusting the device clock alone.
> >>
> >> authors about why they think that age is more resilient than the
> >> above (I believe it is not) and further more why they would find the
> >> above unattractive or difficult to implement in a modern user-agent.
> >>
> >>>>>>>>>>> Thanks,
> >>>>>>>>>>> skylar
> >>>>>>>>>>>
> >> home desktops) it completely impractical. The added complexity pales
> >> in comparison to the difficulty of trying to use timestamps and any
> >> kind of clock sync. No window will be big enough as experience shows
> >> some users have closes that are off by more than an hour and a half.
> >>
> >> server communication should simply use TLS for privacy and MITM
> >> protection on top of MAC instead of using nonces to prevent replay.
> >> The whole point of this kind of replay protection is when TLS is not
> available.
> >>
> >>>>>>>>>>>>> I think it would be preferable to always require a
> >>>>>>>>>>>>> timestamp as part of the authorization header, and maybe
> >>>>>>>>>>>>> even include in the spec a maximum time difference
> between
> >>>>>>>>>>>>> client and server (e.g. 900 seconds) that can be
> >>>>>>>>>>>>> tolerated.  This makes generating the nonce easier also,
> >>>>>>>>>>>>> since the value need to
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> "recommended" practice. If the expectation is that very
> >>>>>>>>>>>>> few if any providers would actually check the timestamp
> >>>>>>>>>>>>> (or moreover, the nonce itself), why add terminology in
> >>>>>>>>>>>>> the draft that requires it? Developers are doing extra
> >>>>>>>>>>>>> access tokens). After the changes, the nonce creation is
> >>>>>>>>>>>>> now the most complicated part of the normalized request
> >>>>>>>>>>>>> string
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>>> dates) then time will also fail. Assuming that a user
> >>>>>>>>>>>>>>> with a bad clock (of by hours or more) will never fix it
> >>>>>>>>>>>>>>> and actually encourages bad user behavior (don't fix
> >>>>>>>>>>>>>>> your clock or Twitterbot will stop working!). Though we
> >>>>>>>>>>>>>>> say that timezones won't bring about the situation of
> >>>>>>>>>>>>>>> changed clock, I'd be to differ. Many users aren't savvy
> >>>>>>>>>>>>>>> enough to change time zone, but just adjust the time to
> >>>>>>>>>>>>>>> local time anyway. Users who are more likely to get it
> >>>>>>>>>>>>>>> right already have auto clock sync enabled (via web,
> >>>>>>>>>>>>>>> mobile, etc.)
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>> the issue time has to be obtained from the server and
> >>>>>>>>>>>>> stored on the client then you have the same problem as
> >>>>>>>>>>>>> with a timestamp - the client clock is not sync'd to the
> >>>>>>>>>>>>> server clock and there is no adjustment. You want this to
> >>>>>>>>>>>>> apply to uses outside of just OAuth, but now requiring the
> >>>>>>>>>>>>> client to be able to determine an issue time based on when
> >>>>>>>>>>>>> it receives
> >>>>>>>>>>>>>
> >> an HTTP request necessarily limits the types of token flows for which
> >> this can be used.
> >>
> >>>>>>>>>>>>> inelegant. It's like having a double ID. Yet it's not an
> >>>>>>>>>>>>> ID, it is actually more of a recording of "my personal
> >>>>>>>>>>>>> clock offset value" but obfuscated several times over (one
> >>>>>>>>>>>>> for each
> >>>>>>>>>>>>>
> >> token) as issue_date.
> >>
> >>>>>>>>>>>>>>> - This implementation assumes software programs use
> the
> >>>>>>>>>>>>>>> computer
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>> authority) to ask it the current time. Then it could store
> >>>>>>>>>>>>> a "my device clock offset" value for the lifetime of the
> >>>>>>>>>>>>> hack and it certainly isn't a foolproof solution. The more
> >>>>>>>>>>>>> I think about the implications of the age parameter, the
> >>>>>>>>>>>>> less I like it. Timestamp has been used for many years in
> >>>>>>>>>>>>> the industry and with reasonable success in relevant
> >> time I think we run a greater risk of stumbling upon unforeseen
> >> issues, such as those outlined above.
> >>
> >>>>>>>>>>>>>>> I recommend the requirement of an age (or timestamp
> for
> >>>>>>>>>>>>>>> that matter)
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>> deem it valuable, timestamp can be an optional value
> >>>>>>>>>>>>> (either as part of the nonce or the overall header, as
> before).
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>>> skylar
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>> general purpose HTTP authentication scheme. It does
> >>>>>>>>>>>>> include an OAuth 2.0 binding which is described in less than
> a page.

---

From: Eran Hammer-Lahav <[email-masked]>
Date: Tue, 31 May 2011 22:58:37 -0700

No need to get worked up. I'm sure Adam didn't mean to offend - that's just his style (speaking as someone who is considered much less polite by a landslide).

I don't think you have made the case why you age is any harder to implement than a timestamp. It is not that your email isn't clear, it's that we're not convinced that timestamp will produce any better result than age in practice. This is purely technical, not political.

However, we did come up with a solution that should cover all bases.

I do strongly object to making this protocol configurable. Configurable authentication schemes are by definition complex and right now MAC is amazingly simple.

EHL

> Sent: Tuesday, May 31, 2011 10:14 PM
> To: Eran Hammer-Lahav
> Cc: [email-masked]; Phil Hunt; OAuth WG
> Yes, but I think my case is very important (eg, being able to use a MAC token
> as a client credential). I don't understand why Adam can't comprehend my
> explanation. My best guess is this is some kind of political game on his front
> to protect the age specification yet I don't understand any motivation for
> being so close-minded. His reply to my last thread was completely
> disrespectful and ignorant. Unless I've made him mad or offended him in
> some way I see no excuse for this behavior.
>
> I'm going to make one more attempt to try to explain this to him over email.
> After that I recommend a Skype call (hopefully brief) or I will work offline
> with Eran to see if we can find some solution.
>
> Btw, in addition to the use case of using MAC tokens for client credentials,
> we also have the use case of re-issuing a valid token multiple times to
> instances of the same client. (eg, the value of ID and secret are constant
> across multiple transmissions to client instances).
>
> Thanks,
> skylar
>

---

From: Skylar Woodward <[email-masked]>
Date: Wed, 1 Jun 2011 08:03:28 +0200

Eran, sorry, where should use cases be officially documented? 

I assume the use cases being more like "HTTP Auth" are not in reference to the ones I've been describing. For my part, I'm focused on OAuth use cases. Both that of a single token being used on multiple devices (or app instances) and that of tokens being presented for client credentials in the OAuth flow. I thought we had already agreed from a previous thread that the MAC token spec should be extensible beyond just use of access tokens and at least to that of client credentials.

skylar

---

From: Skylar Woodward <[email-masked]>
Date: Wed, 1 Jun 2011 08:07:38 +0200

> I don't think you have made the case why you age is any harder to implement than a timestamp. It is not that your email isn't clear, it's that we're not convinced that timestamp will produce any be…

That's no longer my point. I've now realized it doesn't work for all of my uses for MAC token (assuming we validate age, either by the implementation Adam suggested or by the one I had assumed where age is judged "old" by comparing to a device system time).

Let me know if my latest response to Adam doesn't it make it clear why this does not work for either client credentials or a token issued to multiple instances of a client. If not, I'll continue attempting to explain myself.

I also would like to see the specification not to be configurable.

---

From: Igor Faynberg <[email-masked]>
Date: Wed, 01 Jun 2011 02:13:44 -0400

No, no, my little "I told you so" aside, I don't insist on putting this 
in the document, especially that we have already agreed that the use 
case document is a post-2.0 issue.

I think that for the purposes of the discussion on this thread it would 
help if all the use cases in question were clearly described--if only in 
an e-mail for now.  Then it would be a matter of logic to see if there 
is a problem, and if there is one, what the solutions to it might be.

Igor

Eran Hammer-Lahav wrote:
>>>> continue with the explanation. But as a preview, the next points would
>>>>         
>> be:
>>     
>>>>>>> - If issue_date comes form the server, how is it translated to the
>>>>>>>               
>> client?
>>     
>>>>>>>               
>>>>>>>>>>>>> Please change the spec back to using timestamp rather than
>>>>>>>>>>>>>                           
>> age.
>>     
>>>>>>>>>>>>>>>>> Cc: Eran Hammer-Lahav <[email-masked]>,
>>>>>>>>>>>>>>>>>                                   
>> OAuth
>>     
>>>> WG
>>>>
>>>>         
>>>>>>>>>>>>>>>>> <[email-masked]>
>>>>>>>>>>>>>>>>> Subject: Re: [OAUTH-WG] issues with token age
>>>>>>>>>>>>>>>>>                                   
>> element -
>>     
>>>>>>>>>>>>>>>>> MAC token
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> random+timestamp (not age) value, but that seems more
>>>>>>>>>>>>>>>                               
>> of a
>>     
>>>>>>>>>>>>>>> random+MAY or
>>>>>>>>>>>>>>> program execution. All requests needing timestamp would
>>>>>>>>>>>>>>>                               
>> be
>>     
>>>>>>>>>>>>>>> be dropped from the nonce construction. For providers
>>>>>>>>>>>>>>>                               
>> that
>>     
>>>>>>>>>>>>>>>>>> On May 9, 2011, at 12:36 PM, Eran Hammer-Lahav
>>>>>>>>>>>>>>>>>>                                     
>> wrote:
>>     
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>                                     
>>>>>>>>>>>>>>>>>>> http://tools.ietf.org/html/draft-hammer-oauth-v2-
>>>>>>>>>>>>>>>>>>>                                       
>> mac-
>>     
>>>> tok
>>>>
>>>>         
>>>>>>>>>>>>>>>>>>> en
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> One suggestion would be to move section 5.1 into the
>>>>>>>>>>>>>>>                               
>> OAuth
>>     
>>>>>>>>>>>>>>>>>>> * Replaced timestamps with credentials age to
>>>>>>>>>>>>>>>>>>>                                       
>> remove
>>     
>>>> the
>>>>
>>>>         
>>>>>>>>>>>>>>>>>>> need for
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>                                       
>>>>>>>>>>>>>>> clock sync.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>

---

From: Adam Barth <[email-masked]>
Date: Tue, 31 May 2011 23:22:04 -0700

Yeah, sorry, I didn't mean to offend you Skylar.  Your suggested
approach is similar to the approach Eran alluded to earlier.
Hopefully he'll have some new text that will work for your use case
(which I still don't fully understand).

Adam

---

From: Eran Hammer-Lahav <[email-masked]>
Date: Tue, 31 May 2011 23:36:18 -0700

> Sent: Tuesday, May 31, 2011 10:54 PM

> Unfortunately though, this implementation doesn't help my use cases
> because such sequential requirement of a timestamp/age requires all
> devices with the token to be in sync as to the value of timestamp/age. So
> let's move on.

This is not true.

The age value has to be monotonically increasing, but not necessarily unique. Really, any counter will do. The reason why timestamp isn't any better than age or sequence is because ultimately, it is the server's memory restriction which determines the nonces storage size, not anything else (like a time limit).

I am going to change the spec to define age as any 'monotonically increasing, but not necessarily unique' positive numerical value, and give timestamp and time-since-received as two examples, along with a counter. It will also specify that if the numerical value is time-based, it MUST use seconds precision. This should provide a practical solution to everyone.

When the first request comes in, it goes into storage. When the second one comes, you check if its numerical part is equal or greater than the one you previously received. If the number is smaller, you should allow for some margin in case the client is using time-based value, otherwise you reject the request. Once the storage fills, you evict the nonces with the smallest numerical values as needed. The storage size should match the speed in which clients transmit requests.

Unlike timestamps, the margin can be very small, like 60 seconds, because this is time-sync across *client* machines, not the client and server. It is perfectly reasonable to expect a client sharing the same MAC credentials across multiple machines to implement clock sync keeping all machines less than a minute apart.

Any kind of storage-limited nonce-checking is going to fail sometimes even for valid requests because of how the numerical part is generated and how much storage the server has (across all clients). I think this is a very reasonable compromise that in practice, will produce good results with little complexity and plenty of flexibility.

The alternatives presented so far (using timestamps or offering multiple options) will fail completely for the primary use cases this specification was written for.

EHL

---

From: Eran Hammer-Lahav <[email-masked]>
Date: Tue, 31 May 2011 23:38:55 -0700

> Sent: Tuesday, May 31, 2011 11:03 PM
> To: Eran Hammer-Lahav
> Cc: [email-masked]; OAuth WG

This list seems a fine enough place. I have no problem keeping track.

> I assume the use cases being more like "HTTP Auth" are not in reference to
> the ones I've been describing. For my part, I'm focused on OAuth use cases.
> Both that of a single token being used on multiple devices (or app instances)
> and that of tokens being presented for client credentials in the OAuth flow. I
> thought we had already agreed from a previous thread that the MAC token
> spec should be extensible beyond just use of access tokens and at least to
> that of client credentials.

Useful for, yes. Extensible, no. The only extensible part if the choice of algorithm.

> > They are coming in 2-3 directions, the use case isn't really clear (other than
> claims of some flavors being harder than others), and overall this is more
> about general HTTP authentication than OAuth use cases. Don't get me
> wrong - if you want to put the effort in to capture these, go ahead. I just
> think this isn't worth the effort in a formal document.
> >
> > EHL
> >
> >> point, it becomes impractical to keep every use case discussed on
> >> this list recorded.
> >>>
> >>> EHL
> >>>
> >>>
> >>>> Have we *documented* all cases?  (This is what the Use Cases
> >>>> document is supposed to be all about.)
> >>>>
> >>>>>> these nonces due to memory pressure.  The age value lets the
> >>>>>> server reject the nonces with the smallest age values first.  The
> >>>>>> server then rejects any messages with age values smaller than (or
> >>>>>> equal
> >>>> values in your client (they were not issued programmatically to
> >>>> your app). Assuming the MAC token algorithm is used then for
> >>>> establishing client identity (originally one of the uses we, the
> >>>>>> I recommend the date at which the developer obtained the
> >>>>>> credential from Twitter because that is the date when the credential
> was issued.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>> with us getting on the same page (the reason, I thought, why a
> >>>> Skype call would be more efficient and painless). I do think my
> >>>> brittle at that. It doesn't work for any of our uses cases (where
> >>>> the client can't know issue_date w/o the server telling it - in
> >>>> which case we have the equivalent problem as timestamp).
> >>>>
> >>>>>>>>>> synchronized clock.  It's true that a client could
> >>>>>>>>>> synchronize its clock with the network, but our
> >>>>>>>>>> implementation experience is that many clients don't for a
> >>>>>>>>>> variety of reasons.  That means that age better because, you
> know, it works.
> >>>>>>>>>>
> >>>>>>>>>> Adam
> >>>>>>>>>>
> >>>>>>>>>>
> >>>> the time of submission, it will fail. We know many people don't
> >>>> have synchronized clocks, but using age only solves this problem if
> >>>> two assumptions hold true:
> >>>>
> >>>> application. The client has no way of determining on its own when
> >>>> the value was actually issued (unless we communicate that on the
> >>>> developer website and force users to embed that with client_id,
> >>>> which adds usability issues of users copying and entering string
> >>>> date values correctly). The same is actually true for all of our
> >>>> OAuth access tokens because we reissue tokens to the same client_id
> >>>> if they were previously issued and are still valid. (The client
> >>>> would thus think the issue_date was now() when if fact it was the
> >>>> time of the first issue for client_id+scope+grantor_id). Thus, age
> >>>> is really just a
> >>>> demand just to make the convoluted age system work (rather than
> >>>> reuse existing valid tokens). Or, you have to modify the protocol
> >>>> to add server_issue_date and current_server_time into the
> >>>> token-issue
> >>>>>>>>>>>> I can't speak for Mozilla, but I can tell you that many
> >>>>>>>>>>>> folks don't have synchronized clocks, for a wide variety of
> reasons.
> >>>>>>>>>>>> time-since-credentials-issued" but you don't say what
> >>>>>>>>>>>> exactly is fragile about it.  There's nothing particularly
> >>>>>>>>>>>> complex about age, especially when using the monotonic
> >>>>>>>>>>>> clock provided by
> >>>>>>>>>>>>
> >>>> desktops or mobiles (presumably of users and OS not yet
> >>>> sophisticated enough to check network time on their own) should be
> >>>> advised to do clock correction on their own (by pinging a time
> >>>> service) and trusting the device clock alone.
> >>>>
> >>>>>>>>>>>>> I'd also like to hear a convincing argument from the
> >>>>>>>>>>>>> Mozilla
> >>>>>>>>>>>>> co-
> >>>>>>>>>>>>>
> >>>> above (I believe it is not) and further more why they would find
> >>>> the above unattractive or difficult to implement in a modern user-
> agent.
> >>>>
> >>>>>>>>>>>>> Thanks,
> >>>>>>>>>>>>> skylar
> >>>>>>>>>>>>>
> >>>> home desktops) it completely impractical. The added complexity
> >>>> pales in comparison to the difficulty of trying to use timestamps
> >>>> and any kind of clock sync. No window will be big enough as
> >>>> experience shows some users have closes that are off by more than an
> hour and a half.
> >>>>
> >>>>>>>>>>>>>>> system we use.  Once in a while a client has a local
> >>>>>>>>>>>>>>> clock so far out of sync that there is an issue, but it's rare.
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> -Peter
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>> - As Bill mentioned, if the client stores the issue
> >>>>>>>>>>>>>>>>> time based on receipt, then the internal clock changes
> >>>>>>>>>>>>>>>>> with a bad clock (of by hours or more) will never fix
> >>>>>>>>>>>>>>>>> it and actually encourages bad user behavior (don't
> >>>>>>>>>>>>>>>>> fix your clock or Twitterbot will stop working!).
> >>>>>>>>>>>>>>>>> Though we say that timezones won't bring about the
> >>>>>>>>>>>>>>>>> situation of changed clock, I'd be to differ. Many
> >>>>>>>>>>>>>>>>> users aren't savvy enough to change time zone, but
> >>>>>>>>>>>>>>>>> just adjust the time to local time anyway. Users who
> >>>>>>>>>>>>>>>>> are more likely to get it right already have auto
> >>>>>>>>>>>>>>> server clock and there is no adjustment. You want this
> >>>>>>>>>>>>>>> to apply to uses outside of just OAuth, but now
> >>>>>>>>>>>>>>> requiring the client to be able to determine an issue
> >>>>>>>>>>>>>>> time based on when it receives
> >>>>>>>>>>>>>>>
> >>>> an HTTP request necessarily limits the types of token flows for
> >>>> which this can be used.
> >>>>
> >>>>>>>>>>>>>>> clock offset value" but obfuscated several times over
> >>>>>>>>>>>>>>> (one for each
> >>>>>>>>>>>>>>>
> >>>> token) as issue_date.
> >>>>
> >>>>>>>>>>>>>>> internal clock exclusively for timestamp. A robust
> >>>>>>>>>>>>>>> program that is dependent on accurate timestamps
> would
> >>>>>>>>>>>>>>> ping the origin server (or similar trusted time
> >>>>>>>>>>>>>>> authority) to ask it the current time. Then it could
> >>>>>>>>>>>>>>> store a "my device clock offset" value for the lifetime
> >>>>>>>>>>>>>>> of the program execution. All requests needing
> timestamp
> >>>>>>>>>>>>>>> would
> >> be
> >>>>>>>>>>>>>>> around end-user issues of mis-set clocks. It feels like
> >>>>>>>>>>>>>>> a hack and it certainly isn't a foolproof solution. The
> >>>>>>>>>>>>>>> more I think about the implications of the age
> >>>>>>>>>>>>>>> parameter, the less I like it. Timestamp has been used
> >>>>>>>>>>>>>>> for many years in the industry and with reasonable
> >>>>>>>>>>>>>>> success in relevant applications. If we change to a new
> >>>>>>>>>>>>>>> way of trying to sync on
> >>>>>>>>>>>>>>>

---

From: Eran Hammer-Lahav <[email-masked]>
Date: Tue, 31 May 2011 23:44:22 -0700

I think the use cases are pretty well understood (the issue here was not lack of use-case understanding).

Basically, when it comes to client and server deployment, you can have one-to-one, one-to-many, many-to-one, and many-to-many. Each setup presents is own challenges on how to produce unique nonces on the client side (for all requests with the same MAC credentials / access token), and how to store and check on the server side. Once you go beyond one-to-one, it can be extremely hard (which is why most large providers don't check it).

The discussion here was mostly about the "matter of logic"... which is never as easy as it should be. :-)

EHL

> Sent: Tuesday, May 31, 2011 11:14 PM
> To: Eran Hammer-Lahav
> Cc: Phil Hunt; OAuth WG
> No, no, my little "I told you so" aside, I don't insist on putting this in the
> document, especially that we have already agreed that the use case
> document is a post-2.0 issue.
>
> I think that for the purposes of the discussion on this thread it would help if
> all the use cases in question were clearly described--if only in an e-mail for
> now.  Then it would be a matter of logic to see if there is a problem, and if
> there is one, what the solutions to it might be.
>
> Igor
>
> Eran Hammer-Lahav wrote: