-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make use of jwt token for authentication
depends on change in flock-eco to allow 'other' type
- Loading branch information
Showing
20 changed files
with
498 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
PUBLIC_APP_HOST=workday.flock.local:8081 | ||
PUBLIC_APP_URL=http://$PUBLIC_APP_HOST | ||
|
||
PUBLIC_ACCOUNTS_HOST=accounts.flock.local:8081 | ||
PUBLIC_ACCOUNTS_URL=http://$PUBLIC_ACCOUNTS_HOST | ||
ACCOUNTS_SELFSERVICE_URL=$PUBLIC_ACCOUNTS_URL/ui/ | ||
|
||
PUBLIC_KRATOS_URL=http://$PUBLIC_ACCOUNTS_HOST/api | ||
|
||
INTERNAL_KRATOS_URL=http://kratos:4433 | ||
INTERNAL_ADMIN_KRATOS_URL=http://kratos:4434 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,4 @@ secrets.yml | |
node_modules | ||
coverage | ||
.env | ||
/docker/kratos/identities/existing_identities.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
#!/bin/bash | ||
#!/bin/sh | ||
|
||
sleep 3 | ||
|
||
while read line; do | ||
curl --request POST -vvv -sL \ | ||
--fail \ | ||
--header "Content-Type: application/json" \ | ||
--data-binary "@$line" http://kratos:4434/admin/identities | ||
done < <(find . -type f -name "*.json") | ||
|
||
|
||
done < <(find /tmp -type f -name "*.json") | ||
echo $PWD | ||
curl -vvv \ | ||
--header "Accept: application/json" \ | ||
http://kratos:4434/admin/identities | jq '[.[] | {"id": .id, "email": .traits.email} ] ' > /tmp/existing_identities.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"keys": [ | ||
{ | ||
"use": "sig", | ||
"kty": "RSA", | ||
"kid": "75ab2a62-5eeb-4362-8a23-6aa8e0622f4d", | ||
"alg": "RS256", | ||
"n": "u6cx6cF08Jqavfl5Mrh8_KBDXkBu-g6aY1SZsxy31ac_9iZgI3YgEkqkFqO4AvDG8fIydU8BINbbxtvDe6bgTXdagKAshsgqTHLRIrv0gPX7ZEeAU-dahP1dsWtmmgmNCzduPn8N8LBkQuj9DifGKihGr8E7LjcuGx6rvaxpsrl-bQZ5TxKZRq3CkB-vXJM8nXn48hlWwRZ8AcAUcazJFbao5xD0ejzgL1WDndXPix2u_Twl6zDZ8BlMmUKmPQUr9voWLA0CZbmpF3Temp6ENW20ngucrv1MsWE65MQnFqnt5bnlL30OJWdV3u280Dqchhr1b5CtNOdB0lzzGdmVuw", | ||
"e": "AQAB", | ||
"d": "qPy1_DXVI192_qGMvVpaY_3G7TfFOLax3cWv7BZujp7hAMAqT4Tu-Mny3thsu2ktH3Dmc7HD6FjU7k21ysLKt7hF7hNQRcg4H0Q-hbMRSpk53GJvdB-h6qVo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Uee2uKvJsASQw9rNcwtpqKSismxTNE86SoTa8zEYjYDdgYr81zTE" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Authentication and Authorization | ||
|
||
The intended target state for Workday is to extract all forms of Authentication and Authorization from the spring boot | ||
and or react application, but rather make use of an identity aware proxy (Ory's Oathkeeper) to make such decisions. | ||
|
||
This means that all incoming requests to the Spring Boot application are expected to be authenticated, and authorised, | ||
such that the application can focus on the functional logic solely. | ||
|
||
## Roadmap | ||
|
||
1. Setup authentication model in `flock-iam` project | ||
2. Authentication via Ory's Kratos | ||
3. 'Simpler' `GET` and `PUT` endpoints authorization | ||
4. `POST` / create endpoint | ||
5. List endpoints | ||
6. Removal of authorities from workday app itself | ||
|
||
## Workday's permission model | ||
|
||
[Ory's keto](https://www.ory.sh/docs/keto/) make use of a permission model, to determine whether a given subject (a | ||
User) can access an object (e.g. a Workday, a Holiday, etc.). A permission model consists of two parts: a relation | ||
model, and the derived permissions from said these relations. | ||
|
||
Below you'll find the initial _relations model_ for Workday. | ||
 | ||
|
||
Which can be read as | ||
|
||
- A _Person_ is the **owner** of a _Workday_ | ||
- A _User_ is the **owner** of a _Person_ | ||
- A _Flock_ is the **organisational unit** of a _Person_ | ||
- A _Flock_ is the **organisational unit** of a _Flock_ | ||
- A _User_ is the **manager** of a _Flock_ | ||
- etc. | ||
|
||
> ℹ️ | ||
> This model allows manager of (a) Flock. to have a relation with a specific Workday coupled to a person. | ||
> | ||
> E.g. _Workday-X_ is **owned** by _Person-Y_, which is part of **organisational unit** _Flock-Z_, which in turn is **managed** by _User-manager-A_ | ||
## Understanding the Ory stack | ||
|
||
(probably best to move me to flock-iam related repo?) | ||
|
||
There are multiple components to the Ory stack | ||
|
||
- Kratos, ... | ||
- Oathkeeper, ... | ||
- Keto, ... | ||
|
||
## Develop parts here | ||
|
||
To generate a `jwks.json` file: | ||
|
||
```bash | ||
docker run oryd/oathkeeper:v0.40.3 credentials generate --alg RS256 > jwks.json | ||
``` | ||
|
||
- Something docker compose | ||
- Something linking Kratos identities to Workday Users |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.