Nelly-43 commited on
Commit
437b4e2
·
verified ·
1 Parent(s): 3c1b124

Update app_web.py

Browse files
Files changed (1) hide show
  1. app_web.py +9 -0
app_web.py CHANGED
@@ -17,6 +17,15 @@ snapshot_download(repo_id="CGIAR/weai-kb",
17
  local_dir="./"
18
  )
19
 
 
 
 
 
 
 
 
 
 
20
  st.write(st.user)
21
  def cg_admin():
22
  headers = st.context.headers
 
17
  local_dir="./"
18
  )
19
 
20
+ if "OAUTH_CLIENT_ID" in os.environ:
21
+ st.secrets["auth"] = {
22
+ "client_id": os.environ["OAUTH_CLIENT_ID"],
23
+ "client_secret": os.environ["OAUTH_CLIENT_SECRET"],
24
+ "server_metadata_url": f"{os.environ['OPENID_PROVIDER_URL']}/.well-known/openid-configuration",
25
+ "redirect_uri": "https://huggingface.co/spaces/" + os.environ.get("SPACE_ID", "") + "/oauth2/callback",
26
+ "cookie_secret": os.environ.get("OAUTH_CLIENT_SECRET")[:32] # Needs to be string safe
27
+ }
28
+ st.write(st.secrets)
29
  st.write(st.user)
30
  def cg_admin():
31
  headers = st.context.headers