Skip to content

Commit

Permalink
Merge pull request #11 from p2-inc/react/oidc-spa
Browse files Browse the repository at this point in the history
Add OIDC Spa Example
  • Loading branch information
pnzrr authored Oct 9, 2024
2 parents efacf39 + b94b9f9 commit e03844b
Show file tree
Hide file tree
Showing 80 changed files with 61,106 additions and 1,499 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/angular.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:

jobs:
deploy-preview:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.repository == 'p2-inc/examples'
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
working-directory: ./frameworks/angular

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

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:

jobs:
deploy-preview:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.repository == 'p2-inc/examples'
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
working-directory: ./frameworks/nextjs

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

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nuxt-keycloakjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

jobs:
deploy-preview:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.repository == 'p2-inc/examples'
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
working-directory: ./frameworks/nuxt/keycloak-js

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

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nuxt-oidc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

jobs:
deploy-preview:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.repository == 'p2-inc/examples'
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
working-directory: ./frameworks/nuxt/oidc-client-ts

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

steps:
Expand Down
82 changes: 82 additions & 0 deletions .github/workflows/react-oidc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Deploy React OIDC Example

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_REACT_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_DEPLOYMENT_TOKEN }}
on:
push:
branches:
- main
paths:
- "frameworks/reactjs/oidc-client-ts/**"
pull_request:
branches:
- main
paths:
- "frameworks/reactjs/oidc-client-ts/**"

jobs:
deploy-preview:
if: github.event_name == 'pull_request' && github.repository == 'p2-inc/examples'
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20"

- name: Install dependencies
run: npm install
working-directory: ./frameworks/reactjs/oidc-client-ts

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

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

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

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

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

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20"

- name: Install dependencies
run: npm install
working-directory: ./frameworks/reactjs/oidc-client-ts

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

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

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

- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=$VERCEL_TOKEN
working-directory: ./frameworks/reactjs/oidc-client-ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy React Example
name: Deploy React OIDC Spa Example

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
Expand All @@ -9,16 +9,16 @@ on:
branches:
- main
paths:
- "frameworks/reactjs/**"
- "frameworks/reactjs/oidc-spa/**"
pull_request:
branches:
- main
paths:
- "frameworks/reactjs/**"
- "frameworks/reactjs/oidc-spa/**"

jobs:
deploy-preview:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.repository == 'p2-inc/examples'
runs-on: ubuntu-latest

steps:
Expand All @@ -32,25 +32,25 @@ jobs:

- name: Install dependencies
run: npm install
working-directory: ./frameworks/reactjs
working-directory: ./frameworks/reactjs/oidc-client-ts

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

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

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

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

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

steps:
Expand All @@ -64,19 +64,19 @@ jobs:

- name: Install dependencies
run: npm install
working-directory: ./frameworks/reactjs
working-directory: ./frameworks/reactjs/oidc-client-ts

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

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

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

- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=$VERCEL_TOKEN
working-directory: ./frameworks/reactjs
working-directory: ./frameworks/reactjs/oidc-client-ts
4 changes: 2 additions & 2 deletions .github/workflows/remix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

jobs:
deploy-preview:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.repository == 'p2-inc/examples'
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
working-directory: ./frameworks/remix

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

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sveltekit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

jobs:
deploy-preview:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.repository == 'p2-inc/examples'
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
working-directory: ./frameworks/sveltekit

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

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/vue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

jobs:
deploy-preview:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.repository == 'p2-inc/examples'
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
working-directory: ./frameworks/vue

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

steps:
Expand Down
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ This is a repo for code examples showing how to integrate Keycloak with various

## Frameworks

| Framework | Code | Live | Tutorial |
| --------------------- | :----------------------------------------: | :----------------------------------------------------------: | :---------------------------------------------------------------------------: |
| React | [πŸ§‘β€πŸ’»πŸ“](./frameworks/reactjs/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-react-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-managemenet-and-sso-for-reactjs/) |
| Next.js | [πŸ§‘β€πŸ’»πŸ“](./frameworks/nextjs/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-nextjs-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-managemenet-and-sso-for-nextjs/) |
| Remix | [πŸ§‘β€πŸ’»πŸ“](./frameworks/remix/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-remix-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-management-and-sso-for-remix/) |
| Vue | [πŸ§‘β€πŸ’»πŸ“](./frameworks/vue/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-vue-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-managemenet-and-sso-for-vue/) |
| 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/) |
| 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/) |
| Sveltekit | [πŸ§‘β€πŸ’»πŸ“](./frameworks/sveltekit/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-sveltekit-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-management-and-sso-for-sveltekit/) |
| Angular | [πŸ§‘β€πŸ’»πŸ“](./frameworks/angular/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-angular-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-management-and-sso-for-angular/) |
| Django | [πŸ§‘β€πŸ’»πŸ“](./frameworks/django/) | πŸ‘©β€πŸ’»βš’οΈ | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/secure-django/) |
| SpringBoot + Angular | [πŸ§‘β€πŸ’»πŸ“](./frameworks/spring-boot-keycloak/) | πŸ‘©β€πŸ’»βš’οΈ | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/secure-spring-boot/) |
| Framework | Code | Live | Tutorial |
| ---------------------- | :-----------------------------------------: | :----------------------------------------------------------: | :---------------------------------------------------------------------------: |
| 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/) |
| React (oidc-spa) | [πŸ§‘β€πŸ’»πŸ“](./frameworks/reactjs/oidc-spa) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-react-oidcspa-example.vercel.app/) | [πŸ‘©β€πŸ«](#) |
| Next.js | [πŸ§‘β€πŸ’»πŸ“](./frameworks/nextjs/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-nextjs-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-managemenet-and-sso-for-nextjs/) |
| Remix | [πŸ§‘β€πŸ’»πŸ“](./frameworks/remix/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-remix-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-management-and-sso-for-remix/) |
| Vue | [πŸ§‘β€πŸ’»πŸ“](./frameworks/vue/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-vue-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-managemenet-and-sso-for-vue/) |
| 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/) |
| 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/) |
| Sveltekit | [πŸ§‘β€πŸ’»πŸ“](./frameworks/sveltekit/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-sveltekit-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-management-and-sso-for-sveltekit/) |
| Angular | [πŸ§‘β€πŸ’»πŸ“](./frameworks/angular/) | [πŸ‘©β€πŸ’»πŸš€](https://phasetwo-angular-example.vercel.app) | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/instant-user-management-and-sso-for-angular/) |
| Django | [πŸ§‘β€πŸ’»πŸ“](./frameworks/django/) | πŸ‘©β€πŸ’»βš’οΈ | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/secure-django/) |
| SpringBoot + Angular | [πŸ§‘β€πŸ’»πŸ“](./frameworks/spring-boot-keycloak/) | πŸ‘©β€πŸ’»βš’οΈ | [πŸ‘©β€πŸ«](https://phasetwo.io/blog/secure-spring-boot/) |

## Github Actions

Expand Down
37 changes: 37 additions & 0 deletions frameworks/nextjs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e03844b

Please sign in to comment.