Skip to content
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

CCM-6604 (POC): Add sign in and sign out pages that redirect back to a given URL #63

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
644e701
Auth PoC rebase
chris-elliott-nhsd Sep 17, 2024
0562988
Temporarily allow more redirect paths
chris-elliott-nhsd Sep 17, 2024
32760be
Add logging
chris-elliott-nhsd Sep 27, 2024
c8ee1d3
Add logging
chris-elliott-nhsd Sep 30, 2024
342b48b
Add logging
chris-elliott-nhsd Sep 30, 2024
e433d69
Fix linting
chris-elliott-nhsd Sep 30, 2024
8841ec7
Add logging
chris-elliott-nhsd Sep 30, 2024
4585e12
Rewrite signout
chris-elliott-nhsd Oct 2, 2024
2d422c0
Add suspense to redirect component
chris-elliott-nhsd Oct 2, 2024
2cccace
Add logging
chris-elliott-nhsd Oct 2, 2024
42aa4cf
Add return
chris-elliott-nhsd Oct 2, 2024
26d34a4
Fix linting
chris-elliott-nhsd Oct 2, 2024
ccc632a
Fix linting
chris-elliott-nhsd Oct 2, 2024
863ab00
add ampylify CSS stlying
bhansell1 Oct 2, 2024
39ed85a
Fix tests and linting
chris-elliott-nhsd Oct 4, 2024
e62e0cc
Fix line endings
chris-elliott-nhsd Oct 4, 2024
fc4f013
Fix linting
chris-elliott-nhsd Oct 4, 2024
d6e66e7
delete accessibility.sh
chris-elliott-nhsd Oct 4, 2024
ed4f581
Fix redirect path
chris-elliott-nhsd Oct 7, 2024
32c3020
Add identity pool
chris-elliott-nhsd Oct 11, 2024
704291b
Add terraform-managed policy for identity pool
chris-elliott-nhsd Oct 14, 2024
10d109b
Update provider mapping
chris-elliott-nhsd Oct 14, 2024
497b35a
Add unauthenticated policy to identity pool
chris-elliott-nhsd Oct 15, 2024
39adc13
Fix terraform references
chris-elliott-nhsd Oct 15, 2024
184a98a
Deduplicate role names
chris-elliott-nhsd Oct 15, 2024
8a23a83
Fix linting
chris-elliott-nhsd Oct 15, 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
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*vulnerabilities*report*.json
*report*json.zip
.version

version.json
*.code-workspace
!project.code-workspace

Expand Down Expand Up @@ -64,3 +64,12 @@ tests/test-team/playwright/.cache/

#plugin-cache
plugin-cache/
# amplify
node_modules
.amplify
amplify_outputs*
amplifyconfiguration*

.next
.env
.idea
49 changes: 49 additions & 0 deletions amplify/auth/resource.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { DeepPartialAmplifyGeneratedConfigs } from '@aws-amplify/plugin-types';
import { ClientConfig } from '@aws-amplify/client-config';

const userPoolId = process.env.USER_POOL_ID;
const userPoolClientId = process.env.USER_POOL_CLIENT_ID;
const hostedLoginDomain = process.env.HOSTED_LOGIN_DOMAIN ?? 'no-domain';

const appId = process.env.AWS_APP_ID;
const subdomain = process.env.NOTIFY_SUBDOMAIN;
const domainName = process.env.NOTIFY_DOMAIN_NAME;

export const authConfig: DeepPartialAmplifyGeneratedConfigs<ClientConfig> = {
auth: {
aws_region: 'eu-west-2',
user_pool_id: userPoolId,
user_pool_client_id: userPoolClientId,
oauth: {
'identity_providers': [],
'domain': hostedLoginDomain,
'scopes': [
'openid',
'email',
'profile',
'phone',
'aws.cognito.signin.user.admin'
],
'redirect_sign_in_uri': [
`https://${subdomain}.${appId}.amplifyapp.com/auth/`,
`https://${subdomain}.${domainName}/auth/`,
],
'redirect_sign_out_uri': [
`https://${subdomain}.${appId}.amplifyapp.com/`,
`https://${subdomain}.${domainName}/`,
],
'response_type': 'code'
},
username_attributes: ['email'],
standard_required_attributes: ['email'],
user_verification_types: ['email'],
unauthenticated_identities_enabled: false,
password_policy: {
min_length: 8,
require_lowercase: true,
require_uppercase: true,
require_numbers: true,
require_symbols: true,
}
}
};
5 changes: 5 additions & 0 deletions amplify/backend.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineBackend } from '@aws-amplify/backend';
import { authConfig } from './auth/resource';

const backend = defineBackend({});
backend.addOutput(authConfig);
Loading
Loading