Commit Graph

338 Commits

Author SHA1 Message Date
Fredrik Adelöw 6ca29b66c8 Unbreak .well-known OIDC routes
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-06-25 21:31:29 +02:00
Himanshu Mishra 686a740eb9 show better 404 message for unknown provider endpoints
Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
2021-06-24 11:37:49 +02:00
Himanshu Mishra e7b5cf888f remove unnecessary check for missing provider factory
Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
2021-06-24 11:32:57 +02:00
Himanshu Mishra dda7e862a2 remove the "catch-all" auth endpoint and register each separately
200: for properly registered auth providers
404 (with proper message): misconfigured
404 (plain): for unknown providers

Co-authored-by: Mike Lewis <mtlewis@users.noreply.github.com>
Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
2021-06-23 15:13:02 +02:00
Himanshu Mishra d91ec5b1b0 auth: update language
Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
2021-06-22 20:19:58 +02:00
Himanshu Mishra 8e5e5ee46e auth: show better error if auth provider keys are missing
Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
2021-06-22 20:16:26 +02:00
Fredrik Adelöw a88073c29a Update copyright headers
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-06-18 20:26:42 +02:00
blam 2d881016cc chore: dont export default auth provider
Signed-off-by: blam  <ben@blam.sh>
Signed-off-by: blam <ben@blam.sh>
2021-06-18 10:08:26 +02:00
Ben Lambert 79a5fc65a8 Merge pull request #4532 from backstage/rugvip/authin
auth-backend: implement sign-in resolver and profile transform for google provider
2021-06-17 15:33:13 +02:00
Patrik Oldsberg 1aa31f0afc auth-backend: add support for GitLab auth refresh
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-06-16 12:13:27 +02:00
blam f5f290f1c2 feat: update the public api instead of profileTransform it is AuthHandler
Co-authored-by: Fredrik Adelöw <freben@users.noreply.github.com>
Co-authored-by: Johan Haals <johan.haals@gmail.com>
Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com>

Signed-off-by: blam <ben@blam.sh>
2021-06-16 10:56:42 +02:00
blam 551c050e23 feat: actually export the googleSignInResovlers for use in apps
Co-authored-by: Fredrik Adelöw <freben@users.noreply.github.com>
Co-authored-by: Johan Haals <johan.haals@gmail.com>
Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com>

Signed-off-by: blam <ben@blam.sh>
2021-06-16 10:42:48 +02:00
blam 8adb6f6bcd feat: enable backwards compatability and write a simple test
Co-authored-by: Fredrik Adelöw <freben@users.noreply.github.com>
Co-authored-by: Johan Haals <johan.haals@gmail.com>
Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com>

Signed-off-by: blam <ben@blam.sh>
2021-06-16 10:34:48 +02:00
Himanshu Mishra 7dd84f37f0 Apply suggestions from code review
Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>

Co-authored-by: Fredrik Adelöw <freben@gmail.com>
Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-06-15 13:12:39 +02:00
Himanshu Mishra a0949d5892 docs: Add docs explaining sign-in resolvers and profile transform
Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
2021-06-15 13:12:39 +02:00
Himanshu Mishra a848395e2b auth-backend: getEntityClaims make sure target is group kind
We are interested in the User isMemberOf Group relation. So this is just an additional check that the target is of Group kind.

Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
2021-06-15 13:12:39 +02:00
Himanshu Mishra 17a26e7ed3 auth-backend: Use stringifyEntityRef helper
Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
2021-06-15 13:12:39 +02:00
Patrik Oldsberg 1111c0753c auth-backend: implement sign-in and profile options for google provider
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-06-15 13:12:39 +02:00
Patrik Oldsberg 48a5dcf9d5 auth-backend: added SignInResolver and ProfileTransform types
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-06-15 13:12:39 +02:00
Patrik Oldsberg 02d2b8681f auth-backend: add getEntityClaims helper that figures out the claims needed to represent an entity
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-06-15 13:12:39 +02:00
Patrik Oldsberg 3430f0d1ff auth-backend: add ent to possible claims in TokenParams
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-06-15 13:12:39 +02:00
Patrik Oldsberg de81880419 auth-backend: refactor CatalogIdentityClient to depend on TokenIssuer directly
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-06-15 13:12:39 +02:00
Patrik Oldsberg 432af8743f auth-backend: import modules directly for mocking
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-06-08 10:45:54 +02:00
jrusso1020 65e6c45410 Remove circular dependencies
In reference to issue #5563 this does the initial work to remove
all the circular dependencies that we have encountered while
building backstage using bazel. The next step will be to implement
a method to catch these circular dependencies before they get
merged in

Signed-off-by: jrusso1020 <jrusso@brex.com>
2021-05-15 11:17:05 -06:00
Teun Willems 81fa98b3ab fix: displays name from jwt instead of using email address
Signed-off-by: Teun Willems <teun.willems@theapsgroup.com>
2021-04-01 14:25:19 +02:00
Fredrik Adelöw 676ede6438 Update the entity unregister dialog behavior, to support both unregistration as well as plain deletion
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-03-26 09:07:05 +01:00
Tim Hansen 67f66c2962 Fix auth environment type; GitLab audience optional
Signed-off-by: Tim Hansen <timbonicus@gmail.com>
2021-03-24 15:47:17 -06:00
Patrik Oldsberg 6819c2aec8 Merge pull request #4896 from GoWind/expose-verify-nonce
Expose `verifyNonce` and `readState` publicly
2021-03-15 15:20:05 +01:00
Fredrik Adelöw 8686eb38cf Introduce the @backstage/errors package.
Encode thrown errors in the backend as a JSON payload using a facility in that package, and render helpful frontend displays of those errors.

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-03-11 14:31:21 +01:00
Gowind d44777a802 Expose verifyNonce and readState publicly
Signed-off-by: Gowind <petrovgovind@gmail.com>
2021-03-09 18:33:32 +01:00
dependabot[bot] 7616988312 chore(deps): bump knex from 0.21.18 to 0.95.1
Bumps [knex](https://github.com/knex/knex) from 0.21.18 to 0.95.1.
- [Release notes](https://github.com/knex/knex/releases)
- [Changelog](https://github.com/knex/knex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/knex/knex/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-03-08 10:26:45 +01:00
Marcos Lilljedahl 37f9f1a2ee Uses the correct jwks_uri for oidc configuration endpoint
Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
2021-03-04 12:31:21 -03:00
Patrik Oldsberg 570d310c90 Merge pull request #4621 from nhidtran/enhancement/4423
Enhancement/4423: remove the usage of res.send() for res.json()
2021-03-01 17:54:09 +01:00
Brian Leathem d9e8713b28 Replaced nock usage in the oidc provider tests with msw 2021-02-26 11:31:25 -08:00
Fredrik Adelöw ebad7dbe99 Merge pull request #4635 from bleathem/oidc-scope
fixed: Expose a configuration option for the oidc scope
2021-02-23 22:08:37 +01:00
Brian Leathem f31e1061ca Replaced the config jest mock with a ConfigReader in the oidc provider test 2021-02-22 16:39:06 -08:00
Brian Leathem 3af994c81f Expose a configuration option for the oidc scope 2021-02-22 16:00:31 -08:00
Patrik Oldsberg ec504e7b4d auth-backend: fix for refresh token being lost during microsoft login 2021-02-22 17:52:15 +01:00
NHI TRAN ac67aab5dd PR updates
PR updates

fix failing test
2021-02-22 10:23:26 -05:00
NHI TRAN e6fe13c675 upstream master 2021-02-21 13:21:37 -05:00
NHI TRAN f43192207a enhancement: 4423 switch sending back data from server to res.json() instead of res.send()
changeset
2021-02-19 17:05:14 -05:00
Patrik Oldsberg d31228eb42 Merge pull request #4531 from backstage/rugvip/authref
auth-backend: refactor providers to accept options, and delay profile transforms
2021-02-15 19:44:13 +01:00
Patrik Oldsberg 2046701e96 auth-backend: fix a camel 2021-02-15 17:26:51 +01:00
Patrik Oldsberg d9687c524f auth-backend: fix key timestamp parsing with sqlite 2021-02-14 20:00:21 +01:00
Patrik Oldsberg 65fa16dee4 auth-backend: refactor profile transform to happen within handlers instead of verify callback 2021-02-14 17:38:07 +01:00
Patrik Oldsberg b9709efff8 auth-backend: refactor user profile fetch to transform profile outside 2021-02-13 17:42:14 +01:00
Patrik Oldsberg 10e59af4d0 auth-backend: refactor provider factories to accept options 2021-02-12 14:36:46 +01:00
Nils Streijffert cba94afe17 Merge pull request #4386 from backstage/auth-backend-port-to-luxon
Auth backend port to Luxon
2021-02-11 14:22:30 +01:00
Nils Streijffert 072a960518 Move parseDate function 2021-02-11 10:37:58 +01:00
Nils Streijffert 01700ceccd Prettier fix 2021-02-11 10:30:48 +01:00