Skip to content

Commit 0fde050

Browse files
authored
Merge pull request #20 from SecureAuthCorp/feat/angular-samples
Add Angular samples and align port/HTTPS across frameworks
2 parents 255f189 + da2e620 commit 0fde050

59 files changed

Lines changed: 15842 additions & 41 deletions

Some content is hidden

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

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@ updates:
2020
commit-message:
2121
prefix: "deps"
2222

23+
- package-ecosystem: "npm"
24+
directory: "/samples/angular/login-pkce"
25+
schedule:
26+
interval: "weekly"
27+
open-pull-requests-limit: 5
28+
labels:
29+
- "dependencies"
30+
commit-message:
31+
prefix: "deps"
32+
33+
- package-ecosystem: "npm"
34+
directory: "/samples/angular/token-refresh"
35+
schedule:
36+
interval: "weekly"
37+
open-pull-requests-limit: 5
38+
labels:
39+
- "dependencies"
40+
commit-message:
41+
prefix: "deps"
42+
2343
- package-ecosystem: "npm"
2444
directory: "/scripts"
2545
schedule:

.github/workflows/test-js.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Test JS Frameworks
33
on:
44
push:
55
paths:
6-
- "samples/react/**"
6+
- "samples/**"
77
pull_request:
88
paths:
9-
- "samples/react/**"
9+
- "samples/**"
1010
schedule:
1111
- cron: "0 8 * * 1"
1212
workflow_dispatch:
@@ -47,13 +47,22 @@ jobs:
4747
- name: Check formatting
4848
working-directory: ${{ matrix.project }}
4949
run: |
50-
if grep -q '"format:check"' package.json; then
50+
if node -e "process.exit(require('./package.json').scripts?.['format:check'] ? 0 : 1)"; then
5151
yarn format:check
5252
fi
5353
- name: Build
5454
working-directory: ${{ matrix.project }}
55-
run: yarn build
55+
run: |
56+
if node -e "process.exit(require('./package.json').scripts?.['build:ci'] ? 0 : 1)"; then
57+
yarn build:ci
58+
else
59+
yarn build
60+
fi
5661
- name: Test
5762
working-directory: ${{ matrix.project }}
58-
run: yarn test
59-
if: ${{ hashFiles(format('{0}/vitest.config.ts', matrix.project)) != '' }}
63+
run: |
64+
if node -e "process.exit(require('./package.json').scripts?.['test:ci'] ? 0 : 1)"; then
65+
yarn test:ci
66+
elif node -e "process.exit(require('./package.json').scripts?.test ? 0 : 1)"; then
67+
yarn test
68+
fi

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ dist/
77
**/.yarn/*
88
!**/.yarn/releases
99
docs/
10+
environments/environment.ts
11+
!environments/environment.example.ts
1012

placeholder-map.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,15 @@ js:
1313
placeholder: "{{SCOPES}}"
1414
- pattern: "import.meta.env.POST_LOGOUT_URI"
1515
placeholder: "{{POST_LOGOUT_URI}}"
16+
17+
ts:
18+
- pattern: "environment.issuerUrl"
19+
placeholder: "{{ISSUER_URL}}"
20+
- pattern: "environment.clientId"
21+
placeholder: "{{CLIENT_ID}}"
22+
- pattern: "environment.redirectUri"
23+
placeholder: "{{REDIRECT_URI}}"
24+
- pattern: "environment.scopes"
25+
placeholder: "{{SCOPES}}"
26+
- pattern: "environment.postLogoutUri"
27+
placeholder: "{{POST_LOGOUT_URI}}"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
ij_typescript_use_double_quotes = false
14+
15+
[*.md]
16+
max_line_length = off
17+
trim_trailing_whitespace = false
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2+
3+
# Compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
/bazel-out
8+
9+
# Node
10+
/node_modules
11+
npm-debug.log
12+
yarn-error.log
13+
14+
# IDEs and editors
15+
.idea/
16+
.project
17+
.classpath
18+
.c9/
19+
*.launch
20+
.settings/
21+
*.sublime-workspace
22+
23+
# Visual Studio Code
24+
.vscode/*
25+
!.vscode/settings.json
26+
!.vscode/tasks.json
27+
!.vscode/launch.json
28+
!.vscode/extensions.json
29+
!.vscode/mcp.json
30+
.history/*
31+
32+
# Miscellaneous
33+
/.angular/cache
34+
.sass-cache/
35+
/connect.lock
36+
/coverage
37+
/libpeerconnection.log
38+
testem.log
39+
/typings
40+
__screenshots__/
41+
42+
# System files
43+
.DS_Store
44+
Thumbs.db
45+
46+
# Environment secrets
47+
src/environments/environment.ts
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"printWidth": 100,
3+
"singleQuote": false,
4+
"overrides": [
5+
{
6+
"files": "*.html",
7+
"options": {
8+
"parser": "angular"
9+
}
10+
}
11+
]
12+
}

samples/angular/login-pkce/.yarn/releases/yarn-4.13.0.cjs

Lines changed: 940 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
defaultSemverRangePrefix: ""
2+
3+
nodeLinker: node-modules
4+
5+
npmRegistryServer: "https://registry.npmjs.org"
6+
7+
yarnPath: .yarn/releases/yarn-4.13.0.cjs
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Angular SPA — User Login (PKCE)
2+
3+
Minimal Angular app demonstrating OIDC login with PKCE using `angular-auth-oidc-client`.
4+
5+
## Setup
6+
7+
1. Copy `src/environments/environment.example.ts` to `src/environments/environment.ts` and fill in your SecureAuth values
8+
2. `yarn install`
9+
3. `yarn start`
10+
4. Open https://localhost:4250 (accept the self-signed certificate warning)
11+
12+
## What this demonstrates
13+
14+
- OIDC configuration with Authorization Code + PKCE flow
15+
- Login and logout redirects via SecureAuth
16+
- Displaying authenticated user information
17+
- Error handling with OAuth error hints

0 commit comments

Comments
 (0)