Skip to content

Commit

Permalink
feat: serve local ssl for google login
Browse files Browse the repository at this point in the history
  • Loading branch information
solufa committed Sep 11, 2024
1 parent 0735706 commit f7b7da7
Show file tree
Hide file tree
Showing 11 changed files with 161 additions and 9 deletions.
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

![Docker Pulls](https://img.shields.io/docker/pulls/frourio/magnito)
![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/frourio/magnito)
![Docker Image Version (latest by date)](<https://img.shields.io/docker/v/frourio/magnito>)
![Docker Image Version (latest by date)](https://img.shields.io/docker/v/frourio/magnito)

Free, and open Amazon Cognito emulator for Amplify UI

Expand Down Expand Up @@ -73,30 +73,35 @@ You can check the emails sent by Magnito with Inbucket.
## Screenshots
| Sign Up | Sign In |
| --- | --- |
| ![Sign Up](https://frouriojs.github.io/magnito/screenshots/sign-up.png) | ![Sign In](https://frouriojs.github.io/magnito/screenshots/sign-in.png) |
| Forgot Password | Admin |
|![Forgot Password](https://frouriojs.github.io/magnito/screenshots/forgot-password.png) | ![Admin](https://frouriojs.github.io/magnito/screenshots/admin.png) |
| Profile | Change Password |
| ![Profile](https://frouriojs.github.io/magnito/screenshots/profile.png) | ![Change Password](https://frouriojs.github.io/magnito/screenshots/change-password.png) |
| Sign Up | Sign In |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| ![Sign Up](https://frouriojs.github.io/magnito/screenshots/sign-up.png) | ![Sign In](https://frouriojs.github.io/magnito/screenshots/sign-in.png) |
| Forgot Password | Admin |
| ![Forgot Password](https://frouriojs.github.io/magnito/screenshots/forgot-password.png) | ![Admin](https://frouriojs.github.io/magnito/screenshots/admin.png) |
| Profile | Change Password |
| ![Profile](https://frouriojs.github.io/magnito/screenshots/profile.png) | ![Change Password](https://frouriojs.github.io/magnito/screenshots/change-password.png) |
## Features
- Sign Up
- Create a new user account by entering an email address and password.
- Passwords must have at least 8 characters, at least one uppercase letter, at least one lowercase letter, at least one number, and at least one special character.
- Sign In
- Sign in with your email address and password.
- Forgot Password
- Send a password reset email to the email address you registered with.
- Reset Password
- Reset your password by entering a old password and a new password.
- Admin
- List all user information.
- Profile
Expand Down
1 change: 1 addition & 0 deletions client/certificates/SAN.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
subjectAltName = DNS:localhost
20 changes: 20 additions & 0 deletions client/certificates/server.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDTzCCAjegAwIBAgIUezangSUGjDjMpwfu3QWjncFcKnwwDQYJKoZIhvcNAQEL
BQAwRTELMAkGA1UEBhMCSlAxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDA5MTEwOTI3MDdaFw0zNDA5
MDkwOTI3MDdaMEUxCzAJBgNVBAYTAkpQMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw
HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQDOxjM2Ozg7kMaKf/D3nnK/ZJcZp69kCAKFVsxdj8Yj
A+uOUFNpK1YVtAPilI5WOgEWj8YOoyqJWk40So0ViLmvtaapqaWL8w8j7D/FKHmu
z3SXFfyI9tcgj66MPPFwO9GwhwvU78bQOtGfsvLZQQ244/D++ZKuewJXCwvwQTdu
Saref0giiFwgVOLSJoSRx6vqWHlqJpfoZ0OMyra2UkG8OY1nRa3/6SJ2/0DHh66J
BTg1BprWZ4fGJcprg2OCi+si/EyMlDLtouLv0339uxK2r20fhgFGib33IpUD2KKT
7gVa6wovXTPn1g6DCpcMEQpoOEZDmPmO0V4C1F+6rbTtAgMBAAGjNzA1MBQGA1Ud
EQQNMAuCCWxvY2FsaG9zdDAdBgNVHQ4EFgQUVvhHkCmDGI1faRIYHEdjYU+vxHsw
DQYJKoZIhvcNAQELBQADggEBAAK/VVgmw6NIQz1Xv1fmiHiXJylAOBlC6R1uLrO8
5AAwl0N1szVaojmZlTqsfm541Sv8ydfXuwKzkcbowkZ15THHNyDqkDbsEpwTBW/u
u5h+8p5J/V4SDVCN+TBAEDQbbOfV6WrIgN82PsLUeWfJQ0W75YzZrp5VHIcz9SX1
ZP4OtBcjDYeYj6jd/nk7MzJmlZ/gcbUCgdmFWA53qqRVg9S5vq+7qDlJtPvQePMv
hH0UFHYjxYPjVu0rT+gj9Al2+0v8e5r4B3/vRh1J/36nFpvC6wsNAlivUFOb0uKt
6Yzc5aX7f40E6FwjaCctGz9G4fg4Qm692XBy6UMFnXROntc=
-----END CERTIFICATE-----
16 changes: 16 additions & 0 deletions client/certificates/server.csr
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-----BEGIN CERTIFICATE REQUEST-----
MIICijCCAXICAQAwRTELMAkGA1UEBhMCSlAxEzARBgNVBAgMClNvbWUtU3RhdGUx
ITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcN
AQEBBQADggEPADCCAQoCggEBAM7GMzY7ODuQxop/8Peecr9klxmnr2QIAoVWzF2P
xiMD645QU2krVhW0A+KUjlY6ARaPxg6jKolaTjRKjRWIua+1pqmppYvzDyPsP8Uo
ea7PdJcV/Ij21yCProw88XA70bCHC9TvxtA60Z+y8tlBDbjj8P75kq57AlcLC/BB
N25Jqt5/SCKIXCBU4tImhJHHq+pYeWoml+hnQ4zKtrZSQbw5jWdFrf/pInb/QMeH
rokFODUGmtZnh8YlymuDY4KL6yL8TIyUMu2i4u/Tff27EravbR+GAUaJvfcilQPY
opPuBVrrCi9dM+fWDoMKlwwRCmg4RkOY+Y7RXgLUX7qttO0CAwEAAaAAMA0GCSqG
SIb3DQEBCwUAA4IBAQDJ8tbp3FfDpPqd50pf0y5LDMhqujcDR+OyiQLlgghX8+r6
FUh4BOF+mdx8zrJyHzKtjmMW+V2VminwuXoCMOoDDkn154t8kQDeGKNAVDxxPQl7
dIj16UrAkfAp57MXnNvUuoMYi3/CO3kmxaTfLpM90XRZM7I6Ab37KY4kQqC4K0fK
efO2FgrVrtDUy+Yao/n4FrNKhC2Ul6VwWdEAmN8x+F7OUoUkOgML0lvQwxuMxbY7
UBrUwJjxd/W3eS1N9gqoLgWn55cKIbeu0pLn8pVwjn8nPi46lXhdw63xCptufOG5
5xXBhkaHC1hjr6RYBqnsNztJzjzwo60CH4g5gKdc
-----END CERTIFICATE REQUEST-----
28 changes: 28 additions & 0 deletions client/certificates/server.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDOxjM2Ozg7kMaK
f/D3nnK/ZJcZp69kCAKFVsxdj8YjA+uOUFNpK1YVtAPilI5WOgEWj8YOoyqJWk40
So0ViLmvtaapqaWL8w8j7D/FKHmuz3SXFfyI9tcgj66MPPFwO9GwhwvU78bQOtGf
svLZQQ244/D++ZKuewJXCwvwQTduSaref0giiFwgVOLSJoSRx6vqWHlqJpfoZ0OM
yra2UkG8OY1nRa3/6SJ2/0DHh66JBTg1BprWZ4fGJcprg2OCi+si/EyMlDLtouLv
0339uxK2r20fhgFGib33IpUD2KKT7gVa6wovXTPn1g6DCpcMEQpoOEZDmPmO0V4C
1F+6rbTtAgMBAAECggEARvkzFNdI2vE7pMh7jpL9cgJ19uFey2gQbXI4nZi++r/a
t7OMndm5J6PtfXVeUeyA+RyKb/XDoPe1Ri+cs5qFmfEw7qWDZEEenkb2MJdPBRjC
PSXX069eche/YvV8LfjqZbxE7GcNB+ZYk4dZ4gZ5TlA3JV3G4krop7Xr+CB6hUj3
3BJVlGJhaLrNMYuHzANGuoCG6B1JfnucP1rJWVhebSRMfDKkNooZfoo4Jenq2YTJ
/DZBydKWlmJk/ewvmAOPaSNREllCM6D+L1lDGJKJsv0lHhLaOpH07u2i6ovu1Len
SxbmwAmuIuO0xVuRHZWXn8dix1rssZG26SPkQCtBRQKBgQDcO2oQbnrVNHckEF0L
ynJe08O18cSK029BcqmsS8dTrswkIu9YdbxCMStZIoMjmWdhFGc13PXFLrQBZ8J2
OEY+XWnWsY/G6DHf+BBEi4CLwzYAOZ1CnBXOJbGhowgejox0gP3coAUDHQ32OM5f
UXH3frqs8WgwNpGCa2G0S5crFwKBgQDwWz+IlhyYz1hBSP/jdnyWwWWH123bYBbI
m/GfUIq6RxJffFDGn7EgUFiutRjtc0pze0CtFypa/E7vNvlvhio7bWaNgfOEFJvz
nKWS2g4p42g3lxnTGZ0VDkkE2zM2esZcb775yqdchSigYudlFtP0rod1lBX/KBVV
4tJrSzkSmwKBgQCus6MLrdha0OfCAAkPlWTsvGgAKO2Ugu06qc7XErXoOD1QXTYo
ohzZFVAhwTLuRn6vkBPfsox0AvxgMQMd7L4sMsYGvYwkaYVG+e1NsqwiMpTf0NRj
RpY1lck3Q7DpLINW2AyJu5a+RYoRzDZJfr49apaDIm1X8bG0F6LF90DPuQKBgQCI
lbHi8jrJ83nZj5wqLFjcaoZBzYAWG+KWmVeTCvfqpxyfuktEs9a54C6lCTBjLxLt
0OqN8g4Vqi9I7NqOL5WsM50FaQVy1ytQIoJMkzFdSGcev/Ti6zlCj92art3JZbd3
K+FAnZLBlsHhcpK/9Vr5PnynqkFdv+9v4PdmFVcXZQKBgQDHGYLNGBFWDu/T5HvS
2jKChtphjwF0IIYfB7uBGyiF7ui9srA83GIpBRyosM5VjvvNnBECetTonOxRGjSx
G6CBlmLPaKA1RMasYb+dHtN5D4yzowU6mWe5xvY+kGl5/WXb4u30wAfpvRupvj2M
mGQST8BT4Z5JenOQkeXhqh0YfA==
-----END PRIVATE KEY-----
2 changes: 1 addition & 1 deletion client/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
53 changes: 53 additions & 0 deletions client/package-lock.json

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

2 changes: 2 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"scripts": {
"dev": "run-p dev:*",
"dev:client": "next dev -p 5051",
"dev:ssl": "local-ssl-proxy --key ./certificates/server.key --cert ./certificates/server.crt --source 5052 --target 5051",
"dev:hcm": "hcm '**/*.module.css' -w",
"dev:aspida": "aspida --watch",
"dev:path": "pathpida --ignorePath ../.gitignore -s -w",
Expand All @@ -24,6 +25,7 @@
"aws-amplify": "^6.6.0",
"axios": "^1.7.7",
"jotai": "^2.9.3",
"local-ssl-proxy": "^2.0.5",
"next": "^14.2.9",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
10 changes: 10 additions & 0 deletions client/pages/_app.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ function MyApp({ Component, pageProps }: AppProps) {
userPoolId: defaults.userPoolId,
userPoolClientId: defaults.userPoolClientId,
userPoolEndpoint: NEXT_PUBLIC_API_ORIGIN,
loginWith: {
email: true,
oauth: {
domain: 'localhost:5052',
scopes: ['email', 'profile'],
redirectSignIn: ['http://localhost:5051'],
redirectSignOut: ['http://localhost:5051'],
responseType: 'token',
},
},
},
},
});
Expand Down
1 change: 1 addition & 0 deletions client/pages/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const Home = () => {
<Spacer axis="y" size={24} />
<Authenticator
signUpAttributes={['email']}
socialProviders={['google']}
services={{
handleSignUp: (input) =>
signUp({
Expand Down
16 changes: 16 additions & 0 deletions client/pages/oauth2/authorize.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { OAuthConfig } from '@aws-amplify/core';

export type Query = {
redirect_uri: string;
response_type: OAuthConfig['responseType'];
client_id: string;
identity_provider: OAuthConfig['providers'];
scope: OAuthConfig['scopes'];
state: string;
};

const Authorize = () => {
return <div>aaa</div>;
};

export default Authorize;

0 comments on commit f7b7da7

Please sign in to comment.