Skip to content

Commit e03844b

Browse files
authored
Merge pull request #11 from p2-inc/react/oidc-spa
Add OIDC Spa Example
2 parents efacf39 + b94b9f9 commit e03844b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+61106
-1499
lines changed

β€Ž.github/workflows/angular.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818

1919
jobs:
2020
deploy-preview:
21-
if: github.event_name == 'pull_request'
21+
if: github.event_name == 'pull_request' && github.repository == 'p2-inc/examples'
2222
runs-on: ubuntu-latest
2323

2424
steps:
@@ -50,7 +50,7 @@ jobs:
5050
working-directory: ./frameworks/angular
5151

5252
deploy-prod:
53-
if: github.event_name == 'push'
53+
if: github.event_name == 'push' && github.repository == 'p2-inc/examples'
5454
runs-on: ubuntu-latest
5555

5656
steps:

β€Ž.github/workflows/nextjs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818

1919
jobs:
2020
deploy-preview:
21-
if: github.event_name == 'pull_request'
21+
if: github.event_name == 'pull_request' && github.repository == 'p2-inc/examples'
2222
runs-on: ubuntu-latest
2323

2424
steps:
@@ -50,7 +50,7 @@ jobs:
5050
working-directory: ./frameworks/nextjs
5151

5252
deploy-prod:
53-
if: github.event_name == 'push'
53+
if: github.event_name == 'push' && github.repository == 'p2-inc/examples'
5454
runs-on: ubuntu-latest
5555

5656
steps:

β€Ž.github/workflows/nuxt-keycloakjs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717

1818
jobs:
1919
deploy-preview:
20-
if: github.event_name == 'pull_request'
20+
if: github.event_name == 'pull_request' && github.repository == 'p2-inc/examples'
2121
runs-on: ubuntu-latest
2222

2323
steps:
@@ -49,7 +49,7 @@ jobs:
4949
working-directory: ./frameworks/nuxt/keycloak-js
5050

5151
deploy-prod:
52-
if: github.event_name == 'push'
52+
if: github.event_name == 'push' && github.repository == 'p2-inc/examples'
5353
runs-on: ubuntu-latest
5454

5555
steps:

β€Ž.github/workflows/nuxt-oidc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717

1818
jobs:
1919
deploy-preview:
20-
if: github.event_name == 'pull_request'
20+
if: github.event_name == 'pull_request' && github.repository == 'p2-inc/examples'
2121
runs-on: ubuntu-latest
2222

2323
steps:
@@ -49,7 +49,7 @@ jobs:
4949
working-directory: ./frameworks/nuxt/oidc-client-ts
5050

5151
deploy-prod:
52-
if: github.event_name == 'push'
52+
if: github.event_name == 'push' && github.repository == 'p2-inc/examples'
5353
runs-on: ubuntu-latest
5454

5555
steps:

β€Ž.github/workflows/react-oidc.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Deploy React OIDC Example
2+
3+
env:
4+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
5+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_REACT_PROJECT_ID }}
6+
VERCEL_TOKEN: ${{ secrets.VERCEL_DEPLOYMENT_TOKEN }}
7+
on:
8+
push:
9+
branches:
10+
- main
11+
paths:
12+
- "frameworks/reactjs/oidc-client-ts/**"
13+
pull_request:
14+
branches:
15+
- main
16+
paths:
17+
- "frameworks/reactjs/oidc-client-ts/**"
18+
19+
jobs:
20+
deploy-preview:
21+
if: github.event_name == 'pull_request' && github.repository == 'p2-inc/examples'
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v2
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v3
30+
with:
31+
node-version: "20"
32+
33+
- name: Install dependencies
34+
run: npm install
35+
working-directory: ./frameworks/reactjs/oidc-client-ts
36+
37+
- name: Install Vercel CLI
38+
run: npm install -g vercel@latest
39+
40+
- name: Pull Vercel Environment Information
41+
run: vercel pull --yes --environment=preview --token=$VERCEL_TOKEN
42+
working-directory: ./frameworks/reactjs/oidc-client-ts
43+
44+
- name: Build Project Artifacts
45+
run: vercel build --token=$VERCEL_TOKEN
46+
working-directory: ./frameworks/reactjs/oidc-client-ts
47+
48+
- name: Deploy Project Artifacts to Vercel
49+
run: vercel deploy --prebuilt --token=$VERCEL_TOKEN
50+
working-directory: ./frameworks/reactjs/oidc-client-ts
51+
52+
deploy-prod:
53+
if: github.event_name == 'push' && github.repository == 'p2-inc/examples'
54+
runs-on: ubuntu-latest
55+
56+
steps:
57+
- name: Checkout code
58+
uses: actions/checkout@v2
59+
60+
- name: Setup Node.js
61+
uses: actions/setup-node@v3
62+
with:
63+
node-version: "20"
64+
65+
- name: Install dependencies
66+
run: npm install
67+
working-directory: ./frameworks/reactjs/oidc-client-ts
68+
69+
- name: Install Vercel CLI
70+
run: npm install -g vercel@latest
71+
72+
- name: Pull Vercel Environment Information
73+
run: vercel pull --yes --environment=production --token=$VERCEL_TOKEN
74+
working-directory: ./frameworks/reactjs/oidc-client-ts
75+
76+
- name: Build Project Artifacts
77+
run: vercel build --prod --token=$VERCEL_TOKEN
78+
working-directory: ./frameworks/reactjs/oidc-client-ts
79+
80+
- name: Deploy Project Artifacts to Vercel
81+
run: vercel deploy --prebuilt --prod --token=$VERCEL_TOKEN
82+
working-directory: ./frameworks/reactjs/oidc-client-ts

β€Ž.github/workflows/react.yml renamed to β€Ž.github/workflows/react-oidcspa.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy React Example
1+
name: Deploy React OIDC Spa Example
22

33
env:
44
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
@@ -9,16 +9,16 @@ on:
99
branches:
1010
- main
1111
paths:
12-
- "frameworks/reactjs/**"
12+
- "frameworks/reactjs/oidc-spa/**"
1313
pull_request:
1414
branches:
1515
- main
1616
paths:
17-
- "frameworks/reactjs/**"
17+
- "frameworks/reactjs/oidc-spa/**"
1818

1919
jobs:
2020
deploy-preview:
21-
if: github.event_name == 'pull_request'
21+
if: github.event_name == 'pull_request' && github.repository == 'p2-inc/examples'
2222
runs-on: ubuntu-latest
2323

2424
steps:
@@ -32,25 +32,25 @@ jobs:
3232

3333
- name: Install dependencies
3434
run: npm install
35-
working-directory: ./frameworks/reactjs
35+
working-directory: ./frameworks/reactjs/oidc-client-ts
3636

3737
- name: Install Vercel CLI
3838
run: npm install -g vercel@latest
3939

4040
- name: Pull Vercel Environment Information
4141
run: vercel pull --yes --environment=preview --token=$VERCEL_TOKEN
42-
working-directory: ./frameworks/reactjs
42+
working-directory: ./frameworks/reactjs/oidc-client-ts
4343

4444
- name: Build Project Artifacts
4545
run: vercel build --token=$VERCEL_TOKEN
46-
working-directory: ./frameworks/reactjs
46+
working-directory: ./frameworks/reactjs/oidc-client-ts
4747

4848
- name: Deploy Project Artifacts to Vercel
4949
run: vercel deploy --prebuilt --token=$VERCEL_TOKEN
50-
working-directory: ./frameworks/reactjs
50+
working-directory: ./frameworks/reactjs/oidc-client-ts
5151

5252
deploy-prod:
53-
if: github.event_name == 'push'
53+
if: github.event_name == 'push' && github.repository == 'p2-inc/examples'
5454
runs-on: ubuntu-latest
5555

5656
steps:
@@ -64,19 +64,19 @@ jobs:
6464

6565
- name: Install dependencies
6666
run: npm install
67-
working-directory: ./frameworks/reactjs
67+
working-directory: ./frameworks/reactjs/oidc-client-ts
6868

6969
- name: Install Vercel CLI
7070
run: npm install -g vercel@latest
7171

7272
- name: Pull Vercel Environment Information
7373
run: vercel pull --yes --environment=production --token=$VERCEL_TOKEN
74-
working-directory: ./frameworks/reactjs
74+
working-directory: ./frameworks/reactjs/oidc-client-ts
7575

7676
- name: Build Project Artifacts
7777
run: vercel build --prod --token=$VERCEL_TOKEN
78-
working-directory: ./frameworks/reactjs
78+
working-directory: ./frameworks/reactjs/oidc-client-ts
7979

8080
- name: Deploy Project Artifacts to Vercel
8181
run: vercel deploy --prebuilt --prod --token=$VERCEL_TOKEN
82-
working-directory: ./frameworks/reactjs
82+
working-directory: ./frameworks/reactjs/oidc-client-ts

β€Ž.github/workflows/remix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717

1818
jobs:
1919
deploy-preview:
20-
if: github.event_name == 'pull_request'
20+
if: github.event_name == 'pull_request' && github.repository == 'p2-inc/examples'
2121
runs-on: ubuntu-latest
2222

2323
steps:
@@ -49,7 +49,7 @@ jobs:
4949
working-directory: ./frameworks/remix
5050

5151
deploy-prod:
52-
if: github.event_name == 'push'
52+
if: github.event_name == 'push' && github.repository == 'p2-inc/examples'
5353
runs-on: ubuntu-latest
5454

5555
steps:

β€Ž.github/workflows/sveltekit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717

1818
jobs:
1919
deploy-preview:
20-
if: github.event_name == 'pull_request'
20+
if: github.event_name == 'pull_request' && github.repository == 'p2-inc/examples'
2121
runs-on: ubuntu-latest
2222

2323
steps:
@@ -49,7 +49,7 @@ jobs:
4949
working-directory: ./frameworks/sveltekit
5050

5151
deploy-prod:
52-
if: github.event_name == 'push'
52+
if: github.event_name == 'push' && github.repository == 'p2-inc/examples'
5353
runs-on: ubuntu-latest
5454

5555
steps:

β€Ž.github/workflows/vue.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717

1818
jobs:
1919
deploy-preview:
20-
if: github.event_name == 'pull_request'
20+
if: github.event_name == 'pull_request' && github.repository == 'p2-inc/examples'
2121
runs-on: ubuntu-latest
2222

2323
steps:
@@ -49,7 +49,7 @@ jobs:
4949
working-directory: ./frameworks/vue
5050

5151
deploy-prod:
52-
if: github.event_name == 'push'
52+
if: github.event_name == 'push' && github.repository == 'p2-inc/examples'
5353
runs-on: ubuntu-latest
5454

5555
steps:

β€ŽREADME.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@ This is a repo for code examples showing how to integrate Keycloak with various
44

55
## Frameworks
66

7-
| Framework | Code | Live | Tutorial |
8-
| --------------------- | :----------------------------------------: | :----------------------------------------------------------: | :---------------------------------------------------------------------------: |
9-
| React | [πŸ§‘β€πŸ’»πŸ“](./frameworks/reactjs/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-react-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-managemenet-and-sso-for-reactjs/) |
10-
| Next.js | [πŸ§‘β€πŸ’»πŸ“](./frameworks/nextjs/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-nextjs-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-managemenet-and-sso-for-nextjs/) |
11-
| Remix | [πŸ§‘β€πŸ’»πŸ“](./frameworks/remix/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-remix-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-management-and-sso-for-remix/) |
12-
| Vue | [πŸ§‘β€πŸ’»πŸ“](./frameworks/vue/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-vue-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-managemenet-and-sso-for-vue/) |
13-
| Nuxt (keycloak-js) | [πŸ§‘β€πŸ’»πŸ“](./frameworks/nuxt/keycloak-js/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-nuxt-keycloakjs-example.vercel.app/) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-managemenet-and-sso-for-nuxt/) |
14-
| Nuxt (oidc-client-ts) | [πŸ§‘β€πŸ’»πŸ“](./frameworks/nuxt/oidc-client-ts/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-nuxt-oidc-example.vercel.app/) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-managemenet-and-sso-for-nuxt/) |
15-
| Sveltekit | [πŸ§‘β€πŸ’»πŸ“](./frameworks/sveltekit/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-sveltekit-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-management-and-sso-for-sveltekit/) |
16-
| Angular | [πŸ§‘β€πŸ’»πŸ“](./frameworks/angular/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-angular-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-management-and-sso-for-angular/) |
17-
| Django | [πŸ§‘β€πŸ’»πŸ“](./frameworks/django/) | πŸ‘©β€πŸ’»βš’οΈ | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/secure-django/) |
18-
| SpringBoot + Angular | [πŸ§‘β€πŸ’»πŸ“](./frameworks/spring-boot-keycloak/) | πŸ‘©β€πŸ’»βš’οΈ | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/secure-spring-boot/) |
7+
| Framework | Code | Live | Tutorial |
8+
| ---------------------- | :-----------------------------------------: | :----------------------------------------------------------: | :---------------------------------------------------------------------------: |
9+
| React (oidc-client-ts) | [πŸ§‘β€πŸ’»πŸ“](./frameworks/reactjs/oidc-client-ts) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-react-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-managemenet-and-sso-for-reactjs/) |
10+
| React (oidc-spa) | [πŸ§‘β€πŸ’»πŸ“](./frameworks/reactjs/oidc-spa) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-react-oidcspa-example.vercel.app/) | [πŸ‘©β€πŸ«](#) |
11+
| Next.js | [πŸ§‘β€πŸ’»πŸ“](./frameworks/nextjs/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-nextjs-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-managemenet-and-sso-for-nextjs/) |
12+
| Remix | [πŸ§‘β€πŸ’»πŸ“](./frameworks/remix/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-remix-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-management-and-sso-for-remix/) |
13+
| Vue | [πŸ§‘β€πŸ’»πŸ“](./frameworks/vue/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-vue-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-managemenet-and-sso-for-vue/) |
14+
| Nuxt (keycloak-js) | [πŸ§‘β€πŸ’»πŸ“](./frameworks/nuxt/keycloak-js/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-nuxt-keycloakjs-example.vercel.app/) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-managemenet-and-sso-for-nuxt/) |
15+
| Nuxt (oidc-client-ts) | [πŸ§‘β€πŸ’»πŸ“](./frameworks/nuxt/oidc-client-ts/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-nuxt-oidc-example.vercel.app/) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-managemenet-and-sso-for-nuxt/) |
16+
| Sveltekit | [πŸ§‘β€πŸ’»πŸ“](./frameworks/sveltekit/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-sveltekit-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-management-and-sso-for-sveltekit/) |
17+
| Angular | [πŸ§‘β€πŸ’»πŸ“](./frameworks/angular/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-angular-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-management-and-sso-for-angular/) |
18+
| Django | [πŸ§‘β€πŸ’»πŸ“](./frameworks/django/) | πŸ‘©β€πŸ’»βš’οΈ | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/secure-django/) |
19+
| SpringBoot + Angular | [πŸ§‘β€πŸ’»πŸ“](./frameworks/spring-boot-keycloak/) | πŸ‘©β€πŸ’»βš’οΈ | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/secure-spring-boot/) |
1920

2021
## Github Actions
2122

0 commit comments

Comments
Β (0)