16 Commits

Author SHA1 Message Date
David Pursehouse
885ad8a7ef Merge branch 'stable-2.10' into stable-2.11
* stable-2.10:
  OAuth: Simplify protocol implementation
  Allow to link user identity to another OAuth provider
  Update JGit to the 4.0.0.201505050340-m2 version
  Hybrid OpenID/OAuth: Support switching identities
  Hybrid OpenID/OAuth: Allow to link identity accross protocols
  OAuth: Check for session validity during logout

Change-Id: I9da0073a72d8c4327313405b11c66cd253ff640b
2015-05-07 10:37:48 +09:00
Saša Živkov
bad310ec3f Merge "OAuth: Check for session validity during logout" into stable-2.10 2015-05-06 13:00:24 +00:00
David Ostrovsky
f74bd4d8d0 OAuth: Simplify protocol implementation
Change-Id: Ia713593c57d9f68f6fcac8ff3978428052aee5fb
2015-05-05 22:35:07 +02:00
David Ostrovsky
6269edfc68 Allow to link user identity to another OAuth provider
GitHub-Bug: https://github.com/davido/gerrit-oauth-provider/issues/12
Change-Id: I9507d15983cd021ba883afbdf4e526091d55c517
2015-05-05 21:39:50 +02:00
David Ostrovsky
8573bed76a OAuth: Check for session validity during logout
GitHub-Bug: https://github.com/davido/gerrit-oauth-provider/issues/9
Change-Id: Id25792cdf6e28ba8d0f97bcc41d8c6409558314e
2015-04-25 12:39:28 +02:00
David Pursehouse
e6af899893 Merge branch 'stable-2.10' into stable-2.11
* stable-2.10:
  OAuth: Respect servlet context path in URL for login token
  Invalidate OAuth session after web_sessions cache expiration

Change-Id: Id66e2ef07c164c17fa7839ea5c5ae19f26abd621
2015-04-14 14:29:36 +09:00
Shawn Pearce
3cab540024 Merge "OAuth: Respect servlet context path in URL for login token" into stable-2.10 2015-04-14 05:14:40 +00:00
David Ostrovsky
87d15d972d OAuth: Respect servlet context path in URL for login token
Due to a limitation in Jetty [1] we cannot rely on getPathInfo() from
web filter and need to strip the context path manually.

[1] https://bz.apache.org/bugzilla/show_bug.cgi?id=28323

GitHub-Bug: https://github.com/davido/gerrit-oauth-provider/issues/6
Change-Id: Ie5e82abfc1b03b5be72769e05665ecd6099d2897
2015-04-13 05:45:09 +00:00
David Ostrovsky
6b18e3a003 Invalidate OAuth session after web_sessions cache expiration
When web_sessions cache is expired, OAuth session preserves it
logged in state. This makes new sign-in impossible.

Rectify it by checking the states mismatch and invalidating OAuth
session when web_sessions cache was expired.

GitHub-Bug: https://github.com/davido/gerrit-oauth-provider/issues/5
Change-Id: I3d57193c5af29561fd1fac0804dd19c08a0e9dbe
2015-04-12 10:43:25 +02:00
David Pursehouse
245dc68a01 Merge branch 'stable-2.10' into stable-2.11
* stable-2.10:
  Update version to 2.10.2
  Release notes for Gerrit 2.10.2
  Do not return 403 when clicking on Gitweb breadcrumb
  Add log messages to troubleshoot OAuth/OpenID linking
  Remove unused OAuthToken in authorisation URL
  OnlineReindexer: log the success/failure numbers on exit
  Update replication plugin
  OAuth: Allow to link claimed identity to existing accounts
  OAuth: Allow to change username

Change-Id: Ia9fc371b9f957c8e0fc3e215084baa3d31dadd41
2015-03-29 20:49:13 +01:00
Saša Živkov
ca29f4292f Merge "Remove unused OAuthToken in authorisation URL" into stable-2.10 2015-03-26 12:33:24 +00:00
David Ostrovsky
87b782b16b Add log messages to troubleshoot OAuth/OpenID linking
Change-Id: Ic8e13eb570d66e144520c29cd65308ce1f1d15c1
2015-03-26 09:40:53 +00:00
Luca Milanesio
3408d4deb8 Remove unused OAuthToken in authorisation URL
When the user needs to be redirected to the OAuth authentication URL
for entering their credentials, the session is not active yet and
there is no OAuthToken available. There is no value then in having
a RequestToken parameter that will always be null anyway.

Change-Id: I00fdbd32923a51e0c92e6bc0efff551936ec344f
2015-03-25 13:19:14 +00:00
David Ostrovsky
043c85728a OAuth: Allow to link claimed identity to existing accounts
One of use cases OAuth plugin based authentication scheme is aiming
to support is switch from deprecated OpenID provider to OAuth scheme
offered by the same povider. In this specific case the database is
already pre-populated with OpenID accounts. After switching the auth
scheme to OAuth all existing accounts must be linked to the new OAuth
identity.

To support linking new OAuth identity to existing accounts, user info
extension point is extended with claimed identity attribute. When
passed, the account for this identity is looked up and when found new
OAuth identity is linked to it.

Change-Id: Ia6489762dd370bfbbaa16a7418cd3106d2d1112a
2015-03-20 07:31:40 +01:00
David Pursehouse
21b83da225 Merge branch 'stable-2.10' into stable-2.11
* stable-2.10:
  Set version to 2.10.1
  Release notes for Gerrit 2.10.1
  Expose extension point for generic OAuth providers

Change-Id: I33006b0ea12611590979f376816d066883177d4f
2015-03-16 14:10:54 +09:00
David Ostrovsky
e9707d8f85 Expose extension point for generic OAuth providers
Further development of OAuth authentication scheme support suggested in
I86fb8fab3 is to restrict the core to expose only the OAuth extension
point and use Gerrit plugin concept for OAuth provider implementations.

When multiple OAuth providers are deployed on Gerrit site (from one or
multiple plugins) selection page is shown to select OAuth provider per
user base (as it's known for OpenID authentication scheme). The only
difference is that the user can only select between deployed providers.

OAuth logo was borrowed from:

http://en.wikipedia.org/wiki/OAuth and
http://en.wikipedia.org/wiki/File:Oauth_logo.svg
The OAuth logo, designed by Chris Messina
Creative Commons Attribution-Share Alike 3.0 Unported license

Converted as base64 using: http://www.base64-image.de
Source for OAuth protocol description: the same link as above.

Bug: issue 2677
Bug: issue 2715
Contributed-by: Luca Milanesio <luca.milanesio@gmail.com>
Change-Id: I7da0a6b3f2a99b6188bd14cf2818f673a3ddd680
2015-03-06 01:10:40 +01:00