Skip to content

Feature: External Login through OIDC #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 82 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
88c9069
DISPLAY-993: Upgraded openid connect bundle and added external provider
tuj Aug 26, 2023
6755236
Merge branch 'develop' into feature/external-login
tuj Aug 26, 2023
3d4c278
DISPLAY-1001: Started work on supporting external users in entity and…
tuj Sep 1, 2023
8e602a9
DISPLAY-993: Added data providers to limit access to only external us…
tuj Sep 1, 2023
295709a
DISPLAY-993: Fixed mutation endpoints
tuj Sep 1, 2023
fea67ef
DISPLAY-993: Work on activation. Modified flow to match newest versio…
tuj Sep 6, 2023
fbffd67
DISPLAY-993: Changed to seperate entity for activation code
tuj Sep 10, 2023
21d4df4
DISPLAY-993: Gathered migrations into one
tuj Sep 10, 2023
cf70159
DISPLAY-993: Fixed external user authentication and activation
tuj Sep 13, 2023
81940e3
DISPLAY-993: Applied coding standards
tuj Sep 13, 2023
58507fa
DISPLAY-993: Updated changelog
tuj Sep 13, 2023
3b04b88
DISPLAY-993: Removed PHP Upgrade coding standards github actions check
tuj Sep 14, 2023
3de6957
DISPLAY-993: Added check for existing tenant user connection
tuj Sep 18, 2023
94f0e32
DISPLAY-993: Removed activation code after usage
tuj Sep 18, 2023
77515da
DISPLAY-993: Applied coding standards
tuj Sep 18, 2023
1bbe0e1
DISPLAY-993: Fixed access to user
tuj Sep 19, 2023
69e6c1f
DISPLAY-993: Added fields to serialization
tuj Sep 19, 2023
2be105e
DISPLAY-993: Changed refresh code to POST method
tuj Sep 20, 2023
2d0fadc
DISPLAY-993: Changed activation code to be tenant scoped
tuj Sep 20, 2023
c2115eb
DISPLAY-993: Added controller to handle user delete
tuj Sep 20, 2023
b224309
DISPLAY-993: Applied coding standards
tuj Sep 22, 2023
a3903f3
DISPLAY-993: Cleaned up relation
tuj Sep 22, 2023
088d17c
DISPLAY-993: Fixed infrastructure files
tuj Sep 23, 2023
ec7e706
DISPLAY-993: Updated api spec
tuj Sep 23, 2023
1b74d90
DISPLAY-993: Cleaned up code
tuj Sep 23, 2023
e406aec
DISPLAY-993: Cleanup
tuj Sep 24, 2023
33f4767
DISPLAY-1010: Added tests
tuj Sep 25, 2023
b8c623a
DISPLAY-993: Renamed from external user to user
tuj Sep 26, 2023
d7d04f2
DISPLAY-993: Renamed ad oidc provider to internal
tuj Sep 26, 2023
25eb4d0
DISPLAY-993: Removed SetUserType command
tuj Sep 26, 2023
5ea1665
DISPLAY-993: Changed to use providerId as user identifier
tuj Sep 29, 2023
4c46815
DISPLAY-993: Fixed email as slugified version of display name
tuj Sep 29, 2023
1fc2d9b
DISPLAY-993: Changed from email to providerId in token/authenticate e…
tuj Sep 29, 2023
39e119e
DISPLAY-993: Updated markdown setup and fixed linting issues
tuj Sep 29, 2023
38bd220
DISPLAY-993: Added -
tuj Sep 29, 2023
259ae1e
DISPLAY-993: Changed command
tuj Sep 29, 2023
1648341
DISPLAY-399: Added check that the display name does not already exist…
tuj Sep 29, 2023
0b6076a
DISPLAY-993: Fixed merge
tuj Sep 29, 2023
f32f858
DISPLAY-993: Fixed issues raised in review
tuj Oct 2, 2023
de8d9ed
Update README.md
tuj Oct 3, 2023
56ded9b
DISPLAY-993: Fixed issues raised in review
tuj Oct 3, 2023
1e912ef
Merge branch 'feature/external-login-entity-and-api' of github.com:os…
tuj Oct 3, 2023
a9e9c86
DISPLAY-993: Fixed issues raised in review
tuj Oct 4, 2023
bf1e1fe
DISPLAY-993: Fixed issues raised in review
tuj Oct 4, 2023
95813ae
DISPLAY-993: Added user extension to user item provider
tuj Oct 4, 2023
8f39172
DISPLAY-993: Added updates to set user_type for users already in the …
tuj Oct 4, 2023
4a425a5
DISPLAY-993: Changed UserTypeEnum values
tuj Oct 4, 2023
47700c9
DISPLAY-993: Changed how string is concatenated
tuj Oct 4, 2023
4edc952
DISPLAY-993: Fixed roles check in security voter
tuj Oct 4, 2023
fe744e3
DISPLAY-993: Changed role strings to class constants
tuj Oct 4, 2023
2f34c11
DISPLAY-993: Changed getUsername to providerId to fix issue with lexi…
tuj Oct 5, 2023
2f5a3a0
Merge pull request #162 from os2display/feature/external-login-entity…
tuj Nov 9, 2023
c072359
DISPLAY-1093: Fixed merge
tuj Nov 29, 2023
986a2dd
DISPLAY-1093: Started work on providers and processors
tuj Nov 29, 2023
13b5305
DISPLAY-1093: Fixed merge
tuj Dec 1, 2023
289c6ee
DISPLAY-1093: Worked on aligning feature with api platform 3
tuj Dec 4, 2023
0b763e6
DISPLAY-1093: Aligning code with API Platform 3
tuj Dec 6, 2023
4d4968e
DISPLAY-1093: Applied coding standards
tuj Dec 6, 2023
b3861c8
DISPLAY-1093: Fixed merge
tuj Dec 7, 2023
f9b1b03
DISPLAY-1093: Fixed issue with iri generation
tuj Dec 7, 2023
b9b2656
DISPLAY-1093: Fixed user provider
tuj Dec 7, 2023
77816cd
DISPLAY-1093: Updated api spec
tuj Dec 7, 2023
6061fe0
Merge branch 'feature/external-login-align-with-develop' into feature…
tuj Dec 7, 2023
eff41c6
DISPLAY-1093: Fixed issues from automatic review
tuj Dec 7, 2023
91e5506
DISPLAY-1093: Changed github action for markdown
tuj Dec 7, 2023
89283b6
DISPLAY-1093: Fixed markdown lint command naming
tuj Dec 7, 2023
ef36258
DISPLAY-1093: Updated api path names
tuj Dec 8, 2023
ab49103
DISPLAY-1093: Fixed provider repository copy-paste error
tuj Dec 11, 2023
df6294f
DISPLAY-1093: Applied coding standards
tuj Dec 11, 2023
b0f7f2b
DISPLAY-1093: Updated api spec
tuj Dec 11, 2023
ebd4c6e
#394: Changed 'ad' text to 'internal'
tuj Jan 16, 2024
53fbd74
#394: Added unique constaint to UserActivationCode->code
tuj Jan 16, 2024
8ef746e
Merge branch 'develop' into feature/external-login
tuj Jan 16, 2024
0dfc833
#394: Fixed issues raised in code review
tuj Jan 16, 2024
ab4ba70
#394: Fixed issues with open api representation
tuj Jan 19, 2024
53dd1d9
#394: Updated api spec
tuj Jan 19, 2024
414792d
#394: Added comment
tuj Jan 19, 2024
cff03f1
#394: Removed EmptyDTO
tuj Jan 19, 2024
171c127
#394: Removed responses from open api section
tuj Jan 22, 2024
80534ee
#398: Fixed merge
tuj Feb 25, 2024
5f32fcb
#398: Fixed merge
tuj Feb 25, 2024
20a8016
Merge branch 'develop' into feature/external-login
turegjorup Feb 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$'

###> App ###
APP_DEFAULT_DATE_FORMAT='Y-m-d\TH:i:s.v\Z'
APP_ACTIVATION_CODE_EXPIRE_INTERNAL=P2D
###< App ###

###> lexik/jwt-authentication-bundle ###
Expand All @@ -56,14 +57,27 @@ JWT_SCREEN_REFRESH_TOKEN_TTL=2592000 # 30 days
###< gesdinet/jwt-refresh-token-bundle ###

###> itk-dev/openid-connect-bundle ###
# "admin" open id connect configuration variables (values provided by the OIDC IdP)
OIDC_METADATA_URL=ADMIN_APP_METADATA_URL
OIDC_CLIENT_ID=ADMIN_APP_CLIENT_ID
OIDC_CLIENT_SECRET=ADMIN_APP_CLIENT_SECRET
OIDC_REDIRECT_URI=ADMIN_APP_REDIRECT_URI
OIDC_LEEWAY=30
# internal provider
INTERNAL_OIDC_METADATA_URL=INTERNAL_OIDC_METADATA_URL
INTERNAL_OIDC_CLIENT_ID=INTERNAL_OIDC_CLIENT_ID
INTERNAL_OIDC_CLIENT_SECRET=INTERNAL_OIDC_CLIENT_SECRET
INTERNAL_OIDC_REDIRECT_URI=INTERNAL_OIDC_REDIRECT_URI
INTERNAL_OIDC_LEEWAY=30
INTERNAL_OIDC_CLAIM_NAME=navn
INTERNAL_OIDC_CLAIM_EMAIL=email
INTERNAL_OIDC_CLAIM_GROUPS=groups

CLI_REDIRECT=APP_CLI_REDIRECT_URI
# external provider
EXTERNAL_OIDC_METADATA_URL=EXTERNAL_OIDC_METADATA_URL
EXTERNAL_OIDC_CLIENT_ID=EXTERNAL_OIDC_CLIENT_ID
EXTERNAL_OIDC_CLIENT_SECRET=EXTERNAL_OIDC_CLIENT_SECRET
EXTERNAL_OIDC_REDIRECT_URI=EXTERNAL_OIDC_REDIRECT_URI
EXTERNAL_OIDC_LEEWAY=30
EXTERNAL_OIDC_HASH_SALT=
EXTERNAL_OIDC_CLAIM_ID=signinname

# cli redirect url
OIDC_CLI_REDIRECT=APP_CLI_REDIRECT_URI
###< itk-dev/openid-connect-bundle ###

###> redis ###
Expand Down
26 changes: 7 additions & 19 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,31 +190,19 @@ jobs:
markdownlint:
runs-on: ubuntu-latest
name: markdownlint
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache yarn packages
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
fetch-depth: 2

- name: Yarn install
uses: actions/setup-node@v3
with:
node-version: "16"
- run: yarn install
- name: Install
run: docker run --rm -v .:/app --workdir=/app node:18 npm install

- name: markdownlint
run: yarn markdownlint README.md docs
- name: Markdown lint
run: docker run --rm -v .:/app --workdir=/app node:18 npm run coding-standards-check

apispec:
runs-on: ubuntu-latest
Expand Down
116 changes: 63 additions & 53 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

- [#179](https://github.com/os2display/display-api-service/pull/179)
- Fixed how playlists are added/removed from slides.
- [#184](https://github.com/os2display/display-api-service/pull/184)
- Added RelationsModifiedTrait to serialization groups.
- [#186](https://github.com/os2display/display-api-service/pull/186)
- Fix for "relations modified" not set correctly on OneToMany relations
- [#185](https://github.com/os2display/display-api-service/pull/185)
- Disable RelationsModified listener when loading fixtures to optimize performance
- [#184](https://github.com/os2display/display-api-service/pull/184)
- Added RelationsModifiedTrait to serialization groups.
- [#182](https://github.com/os2display/display-api-service/pull/182)
- Changed "Theme" api output to have "Logo" embedded to avoid 404 errors when fetching logo from other shared slide
w. foreign tenant.
- [#181](https://github.com/os2display/display-api-service/pull/181)
- Update minimum PHP version to 8.2 to support trait constants
- Add 'relationsModified' timestamps on relevant entities and API resources.
- [#179](https://github.com/os2display/display-api-service/pull/179)
- Fixed how playlists are added/removed from slides.
- [#178](https://github.com/os2display/display-api-service/pull/178)
- Fixed issues with objects not being expanded in collections.
- [#176](https://github.com/os2display/display-api-service/pull/176)
Expand All @@ -43,6 +43,16 @@ All notable changes to this project will be documented in this file.
Updated Symfony development packages.
- [#165](https://github.com/os2display/display-api-service/pull/165)
Symfony 6.3
- [#162](https://github.com/os2display/display-api-service/pull/162)
- Adds "external" openid-connect provider.
- Renamed "oidc" openid-connect provider to "internal".
- Modifies User to support external user type.
- Adds command to set user type.
- Expands api with external user endpoints.
- Upgrades openid-connect bundle to 3.1 to support multiple providers.
- Changes php requirement in composer.json to >= 8.1.
- Removed PHP Upgrade coding standards github actions check.
- Changed user identifier from email to providerId. Made email nullable. Copied value from email to providerId in migration.
- [#161](https://github.com/os2display/display-api-service/pull/161)
Fixed non-entity related psalm errors.

Expand All @@ -60,91 +70,91 @@ All notable changes to this project will be documented in this file.
## [1.4.0] - 2023-09-14

- [#160](https://github.com/os2display/display-api-service/pull/160)
Added app:feed:list-feed-source command. Removed listing from app:feed:remove-feed-source command.
- Added app:feed:list-feed-source command. Removed listing from app:feed:remove-feed-source command.
- [#159](https://github.com/os2display/display-api-service/pull/159)
Fixed sprintf issue.
- Fixed sprintf issue.
- [#158](https://github.com/os2display/display-api-service/pull/158)
Added thumbnails for image resources
- Added thumbnails for image resources

## [1.3.2] - 2023-07-11

- [#157](https://github.com/os2display/display-api-service/pull/157)
Fix question input on create user command
- Fix question input on create user command

## [1.3.1] - 2023-07-11

- [#156](https://github.com/os2display/display-api-service/pull/156)
Fix permissions in create release github action
- Fix permissions in create release github action

## [1.3.0] - 2023-07-11

- [#155](https://github.com/os2display/display-api-service/pull/155)
Set up separate image builds for itkdev and os2display
- Set up separate image builds for itkdev and os2display
- [#154](https://github.com/os2display/display-api-service/pull/154)
Updated add user command to ask which tenants user belongs to
- Updated add user command to ask which tenants user belongs to
- [#151](https://github.com/os2display/display-api-service/pull/151)
Fixed feed data provider id issue
- Fixed feed data provider id issue
- [#150](https://github.com/os2display/display-api-service/pull/150)
Update docker build to publish to "os2display" org on docker hub. Update github workflow to latest actions.
- Update docker build to publish to "os2display" org on docker hub.
- Update github workflow to latest actions.
- [#148](https://github.com/os2display/display-api-service/pull/148)
Updated `EventDatabaseApiFeedType` query ensuring started
but not finished events are found.
- Updated `EventDatabaseApiFeedType` query ensuring started but not finished events are found.
- [#157](https://github.com/os2display/display-api-service/pull/157)
Refactored all feed related classes and services
- Minor update of composer packages
- Updated psalm to version 5.x
- Refactored all feed related classes and services
- Minor update of composer packages
- Updated psalm to version 5.x

## [1.2.9] - 2023-06-30

- [#153](https://github.com/os2display/display-api-service/pull/153)
Fixed nginx entry script
- Fixed nginx entry script

## [1.2.8] - 2023-05-25

- [#145](https://github.com/os2display/display-api-service/pull/145)
Gif mime type possible.
- Gif mime type possible.

## [1.2.7] - 2023-04-03

- [#143](https://github.com/os2display/display-api-service/pull/143)
Fixed token ttl not set correctly for ScreenUsers
- Fixed token ttl not set correctly for ScreenUsers
- [#142](https://github.com/os2display/display-api-service/pull/142)
Make it possible to upload svg in api.
- Make it possible to upload svg in api.

## [1.2.6] - 2023-03-24

- [#141](https://github.com/os2display/display-api-service/pull/141)
Readded redis to docker-compose.
- Readded redis to docker-compose.

## [1.2.5] - 2023-03-16

- [#138](https://github.com/os2display/display-api-service/pull/138)
Fixed Tenant and command to allow for empty fallbackImageUrl.
- Fixed Tenant and command to allow for empty fallbackImageUrl.
- [#139](https://github.com/os2display/display-api-service/pull/139)
Changed from service decoration to event listeners to re-enable setting `tenants` on the response from `/v1/authentication/token`.
Ensure same response data from both `/v1/authentication/token` and `/v1/authentication/token/refresh`endpoints.
Added `user` and `tenants` to JWT payload.
- Changed from service decoration to event listeners to re-enable setting `tenants` on the response from `/v1/authentication/token`.
- Ensure same response data from both `/v1/authentication/token` and `/v1/authentication/token/refresh`endpoints.
- Added `user` and `tenants` to JWT payload.

## [1.2.4] - 2023-03-07

- [#133](https://github.com/os2display/display-api-service/pull/133)
Adds upload size values to nginx config.
- Adds upload size values to nginx config.
- [#137](https://github.com/os2display/display-api-service/pull/137)
Default sorting for templates is by title
- Default sorting for templates is by title

## [1.2.3] - 2023-02-14

- [#136](https://github.com/os2display/display-api-service/pull/136)
Updated to latest version of github actions
- Updated to latest version of github actions
- [#134](https://github.com/os2display/display-api-service/pull/134)
Fix bug where `JWT_SCREEN_REFRESH_TOKEN_TTL` value is not used when refresh token is renewed
- Fix bug where `JWT_SCREEN_REFRESH_TOKEN_TTL` value is not used when refresh token is renewed

## [1.2.2] - 2023-02-08

- [#132](https://github.com/os2display/display-api-service/pull/132)
Added `RefreshToken` entity to fix migrations error.
- Added `RefreshToken` entity to fix migrations error.
- [#135](https://github.com/os2display/display-api-service/pull/135)
Updated code styles.
- Updated code styles.

## [1.2.1] - 2023-02-02

Expand All @@ -153,44 +163,44 @@ Gif mime type possible.
## [1.2.0] - 2023-01-05

- [#130](https://github.com/os2display/display-api-service/pull/130)
Added changelog.
Added github action to enforce that PRs should always include an update of the changelog.
- Added changelog.
- Added github action to enforce that PRs should always include an update of the changelog.
- [#129](https://github.com/os2display/display-api-service/pull/129)
Downgraded to Api Platform 2.6, since 2.7 introduced a change in serialization. Locking to 2.6.*
- Downgraded to Api Platform 2.6, since 2.7 introduced a change in serialization. Locking to 2.6.*
- [#127](https://github.com/os2display/display-api-service/pull/127)
Updated docker setup and actions to PHP 8.1.
Updated code style.
- Updated docker setup and actions to PHP 8.1.
- Updated code style.
- [#128](https://github.com/os2display/display-api-service/pull/128)
Added ttl_update: true config option for jwt refresh bundle.
Added refresh_token_expiration key to respone body.
- Added ttl_update: true config option for jwt refresh bundle.
- Added refresh_token_expiration key to respone body.
- [#124](https://github.com/os2display/display-api-service/pull/124)
Created ThemeItemDataProvider instead of
ThemeOutputDataTransformer, to make theme accessible in the client on shared slides.
Made it possible for editors to view themes and connect them to slides: security: 'is_granted("ROLE_SCREEN") or
is_granted("ROLE_ADMIN") or is_granted("ROLE_EDITOR")'.
- Created ThemeItemDataProvider instead of
- ThemeOutputDataTransformer, to make theme accessible in the client on shared slides.
- Made it possible for editors to view themes and connect them to slides: security: 'is_granted("ROLE_SCREEN") or
is_granted("ROLE_ADMIN") or is_granted("ROLE_EDITOR")'.
- [#126](https://github.com/os2display/display-api-service/pull/126)
Added config option for setting token TTL for screen users.
- Added config option for setting token TTL for screen users.
- [#123](https://github.com/os2display/display-api-service/pull/123)
Updated fixtures.
- Updated fixtures.
- [#125](https://github.com/os2display/display-api-service/pull/125)
Changed error handling to not always return empty array even though it is only one resource that reports error.
Added error logging.
- Changed error handling to not always return empty array even though it is only one resource that reports error.
- Added error logging.
- [#122](https://github.com/os2display/display-api-service/pull/122)
Updated docker setup to match new itkdev base setup.
- Updated docker setup to match new itkdev base setup.
- [#121](https://github.com/os2display/display-api-service/pull/121)
Changed load screen layout command to allow updating existing layouts.
- Changed load screen layout command to allow updating existing layouts.

## [1.1.0] - 2022-09-29

- [#120](https://github.com/os2display/display-api-service/pull/120)
Fixed path for shared Media.
- Fixed path for shared Media.
- [#119](https://github.com/os2display/display-api-service/pull/119)
KOBA feed source: Changed naming in resource options. Sorted options.
- KOBA feed source: Changed naming in resource options. Sorted options.

## [1.0.4] - 2022-09-05

- [#117](https://github.com/os2display/display-api-service/pull/117)
Removed screen width and height. Added resolution/orientation.
- Removed screen width and height. Added resolution/orientation.

## [1.0.3] - 2022-09-01

Expand Down
Loading