Skip to content

Commit

Permalink
Implement OAuth2 and others for member authentication (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
No767 authored Dec 23, 2024
1 parent 7587041 commit ee49de7
Show file tree
Hide file tree
Showing 6 changed files with 427 additions and 35 deletions.
49 changes: 48 additions & 1 deletion config-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ kanae:

# Host that the server will use.
# Set to 0.0.0.0 if running in Docker
host: 127.0.0.1
host: "localhost"

# Port that the server binds to.
# Defaults to 8000
Expand Down Expand Up @@ -40,6 +40,53 @@ kanae:
# it will always be set to 9555
port: 9555

# These are used by SuperTokens for our backend auth
auth:

# Name of the app. Defaults to ucmacm-website
name: "ucmacm-website"

# Domain (includes https://) of the backend server (aka the domain for Kanae)
# If you are testing, leave this to be http://localhost:8000
# MUST be replaced in production
api_domain: "http://localhost:8000"

# Domain (include https://) of the frontend website
# If you are testing, leave this to be http://localhost:5173 and have the frontend up
# MUST be replaced in production
website_domain: "http://localhost:5173"

# The backend SuperToken managed or core instance.
# https://try.supertokens.com can be used for demo purposes, but we will be replacing it with a developer version
connection_uri: ""

# API key used for SuperTokens
# Used on the hosted version
api_key: ""


# Social login providers (e.g. Google, Github, etc)
providers:

# OAuth2 login using Google accounts
# Follow the setup instructions here: https://support.google.com/cloud/answer/6158849?hl=en
# Auth callback is http://localhost:5173/auth/callback/google
google:

# OAuth2 client id
client_id: ""

# OAuth2 client secret
client_secret: ""

# OAuth2 scopes
# Currently these are the ones needed:
# - https://www.googleapis.com/auth/userinfo.profile
# - https://www.googleapis.com/auth/userinfo.email
scopes:
- "https://www.googleapis.com/auth/userinfo.profile"
- "https://www.googleapis.com/auth/userinfo.email"

# The PostgreSQL connection URI that is used to connect to the database
# The URI must be valid, and components will need to be quoted.
# See https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ typing-extensions>=4.12.2,<5
slowapi>=0.1.9,<1
redis[hiredis]>=5.0.8,<6.0.0
orjson>=3.10.10,<4
fastapi-pagination>=0.12.32,<1
fastapi-pagination>=0.12.32,<1
supertokens-python>=0.26.1,<1
Loading

0 comments on commit ee49de7

Please sign in to comment.