20 Commits

Author SHA1 Message Date
Pudong
5ebe1cca85
Add PKCE support for OIDC (#20094) 2024-08-08 03:53:46 -04:00
Huiwen
c4b53f9320
Support validate claims with CEL expr for SSO (#20083)
* [papi] proto update

* [dashboard] nit TODO

* [papi] implement cel expression verify

* drop me: Add debug logs

* 1

* tidy

* export cel error message

* 💄 dashboard

* improve error

* nit doc
2024-08-07 02:33:45 -04:00
Huiwen
7b615ab7cd
Bring more compatibility to OIDC verification (#19813)
* change something

* add userinfo fetch

* fixup

* fixup

* fixup

* remove unnecessary code

* fixup

* change logic

* fixup

* fixup

* fixup comment
2024-05-31 14:40:12 +08:00
Milan Pavlik
b5a34c9b12
[jwt] OIDC Sessions are JWT only WEB-103 (#17839)
* [jwt] OIDC Sessions are JWT only

* Fix
2023-06-06 21:04:57 +08:00
Milan Pavlik
056ba722f7
[server] Issue JWT cookie in IAM Sessions for OIDC sign-in (#17762) 2023-05-30 22:54:04 +08:00
Milan Pavlik
321da4322e
[gitpod-db] Rename Go definitions from Teams to Organizations (#17763)
* [gitpod-db] Rename Go definitions from Teams to Organizations

* fix

* fix

* Fix

* fix

* Fix
2023-05-30 19:09:04 +08:00
Alex Tugarev
ae9d418e7c
[papi] Start request should search for single Org with active SSO (#17761) 2023-05-26 18:16:00 +08:00
Alex Tugarev
d52ba759ae
Implement deactivation of OIDC client configs – WEB-333 (#17659)
* [papi] implement deactivation of OIDC client configs

* fix: add test for record not found

* simplify db.SetClientConfigActiviation
2023-05-22 19:55:56 +08:00
Alex Tugarev
7952153237
Add verify param to OIDC start request – WEB-333 (#17576)
* [papi] Add `verified` flag to config and `ActivateClientConfig` to OIDC service

* [papi] implement `ActivateClientConfig`

* [gitpod-db/go] add `setClientConfigVerifiedFlag`

* [gitpod-db/migration] add `d_b_oidc_client_config.verified` field

* [papi] Don't deactive on UpdateClientConfig

* [gitpod-db/go] add missing `Verified` field

* On "activate" request also mark as verified.

* [gitpod-db/go] fix mapping of `Verified` field

* [papi] ensure only verified OIDC client configs can be activated

* [papi] Skip the sign-in on verify-only requests.

* [papi] fix skipped tests

* [papi] fix mapping of OIDC configs

* rename RPC method

* fix tests after adding validation of claims

* fix: activation of record should deactivate others

* fix: update should unverify the entry

* remove Debug()

* [db-migration] fix: mark active entries as verified
2023-05-16 21:09:02 +08:00
Milan Pavlik
89e9ad0075
[sso] Validate Issuer URL + fix trailing slash WEB-345 (#17623)
* [sso] Fix trailing slash in issuer

* fix

* fix

* fix
2023-05-16 16:08:01 +08:00
Alex Tugarev
02ce06638c
[papi] validate ID token claims – WEB-337 (#17615)
* [papi] validate ID token claims

Some claims (e.g. email, name) are required. While it's defaults with most IdPs, some require manual configuration to make those claims appear in ID tokens.

* add test cases
2023-05-16 15:56:01 +08:00
Alex Tugarev
9266c7617c
[papi] select active OIDC config for start request – WEB-316 (#17518)
* [papi] select active OIDC config for start request

* rename GetActiveOIDCClientConfigByOrgSlug

* add CreateTeams helper

* [papi] Ensure activation of SSO config deactivates previous one

* applied PR review comment
2023-05-10 19:56:55 +08:00
Alex Tugarev
7ef79efd91
[SSO] Use ClientConfigID & Subject as composite key for identities WEB-279 (#17463)
* [SSO] Use ClientConfigID & Subject as composite key for identities

* Add tests for CreateSession
2023-05-02 21:09:40 +08:00
Sven Efftinge
cbd56c2592
Frictionless login for dedicated (#17432) 2023-05-02 02:12:40 +08:00
Alex Tugarev
76c61533a6
[OIDC] Enable mark client config as "active" (#17365)
* [gitpod-db] Add `d_b_oidc_client_config.active` field

* [papi] Add OIDCClientConfig.active to proto def

* [gitpod-db] Add OIDCClientConfig.active

* [papi] Add `activate` param to `/oidc/start` endpoint handler

If provided it should mark the OIDC client config as `active` in the DB.

* Fix propagation of state params and add tests.

* fix import of deprecated ioutil

* refactor GetStartParams

* consider `activate` from create request
2023-04-27 21:35:36 +08:00
Milan Pavlik
d9ccc1d141
[papi] OIDC service signs state with HS256, reusing signing PK - WEB-206 (#17328)
* [papi] OIDC service signs state with RSA256

* Fix

* retest

* fix

* add test
2023-04-24 17:14:45 +08:00
Alex Tugarev
7ecc196baa
Sign in with SSO (#17055)
* [experiment] Add "Sign in with SSO" to Login

Reusing existing parts:
 * `/complete-auth` page of Dashbaord to forward results of authN flows running in a modal
 * Adding preliminary UI to the Login view: Org-slug and simple button.

* [gitpod-db] get team/org by slug

* [gitpod-db] fix OIDCClientConfig.OrganizationID field's type

* [oidc] consider returnTo URL

* [oidc] consider orgSlug param from start request

* [oidc] fix oauth2 clientId propagation

* [oidc] fix a flaky test

* [onboarding] skip for organizational accounts

* Move SSO Login UI into it's own component

* adjust validation a bit, add useCallbacks

* adding GetOIDCClientConfigByOrgSlug

* add table name

* removing commented out code

---------

Co-authored-by: Brad Harris <bmharris@gmail.com>
2023-03-29 15:49:39 +02:00
Alex Tugarev
80dc959279 [oidc] encode and validate state params
Using JWT tokens for encoding/decoding/validation of state params carried throughout the OIDC/OAuth2 flow.

Validating of integrity is crucial, as this piece of information contains the ID of the OIDC client to continue with when Gitpod receives the callback from a 3rd party. Tests should show that expiration time is checked and signature validation is effective.
2023-02-15 18:55:20 +01:00
Gero Posmyk-Leinemann
d2464f6ee8 [server, iam] Attach user to an Organization on OIDC login 2023-02-06 15:10:44 +01:00
Milan Pavlik
27f1ba0939 [public-api] Move oidc handler package from iam 2023-01-23 15:45:31 +01:00