Spaces:
Runtime error
Runtime error
FIX #1: fetch metadata from /.well-known/openid-configuration
Browse files
auth.py
CHANGED
@@ -17,19 +17,16 @@ for value in (OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET, OAUTH_SCOPES, OPENID_PROVIDE
|
|
17 |
if value is None:
|
18 |
raise ValueError("Missing environment variable")
|
19 |
|
20 |
-
AUTHORIZE_URL = OPENID_PROVIDER_URL + "/oauth/authorize"
|
21 |
-
ACCESS_TOKEN_URL = OPENID_PROVIDER_URL + "/oauth/token"
|
22 |
USER_INFO_URL = OPENID_PROVIDER_URL + "/oauth/userinfo"
|
|
|
23 |
|
24 |
oauth = OAuth()
|
25 |
oauth.register(
|
26 |
name="huggingface",
|
27 |
client_id=OAUTH_CLIENT_ID,
|
28 |
client_secret=OAUTH_CLIENT_SECRET,
|
29 |
-
access_token_url=ACCESS_TOKEN_URL,
|
30 |
-
authorize_url=AUTHORIZE_URL,
|
31 |
-
api_base_url=OPENID_PROVIDER_URL,
|
32 |
client_kwargs={"scope": OAUTH_SCOPES},
|
|
|
33 |
)
|
34 |
|
35 |
|
|
|
17 |
if value is None:
|
18 |
raise ValueError("Missing environment variable")
|
19 |
|
|
|
|
|
20 |
USER_INFO_URL = OPENID_PROVIDER_URL + "/oauth/userinfo"
|
21 |
+
METADATA_URL = OPENID_PROVIDER_URL + "/.well-known/openid-configuration"
|
22 |
|
23 |
oauth = OAuth()
|
24 |
oauth.register(
|
25 |
name="huggingface",
|
26 |
client_id=OAUTH_CLIENT_ID,
|
27 |
client_secret=OAUTH_CLIENT_SECRET,
|
|
|
|
|
|
|
28 |
client_kwargs={"scope": OAUTH_SCOPES},
|
29 |
+
server_metadata_url=METADATA_URL,
|
30 |
)
|
31 |
|
32 |
|