apple muncy commited on
Commit
f102978
·
1 Parent(s): c6a5c44

switch to FQDN

Browse files

Signed-off-by: apple muncy <[email protected]>

Files changed (2) hide show
  1. README.md +3 -3
  2. auth_server.py +4 -4
README.md CHANGED
@@ -10,8 +10,8 @@ short_description: simple Auth Server
10
  app_port: 7860
11
  ---
12
  # This Oauth server is the code found at
13
- [modelcontextprotocol /
14
- python-sdk]( https://github.com/modelcontextprotocol/python-sdk/tree/main/examples/servers/simple-auth/mcp_simple_auth) with changes made to run in a Huggingface Space as an simple free standing MCP Oauth Server.
15
 
16
  Check out [AuthO]( https://auth0.com/) for a next step.
17
 
@@ -20,7 +20,7 @@ The code was originally written to run with client, resource server, and auth se
20
  **To run this in your own HF Space**
21
  # Duplicate this space
22
  ## Add 3 secrets to the space
23
- 1. AS_HOST_NAME ((embeded host name) eg applemuncy-as)
24
  2. USER_NAME
25
  3. USER_PASSWORD
26
 
 
10
  app_port: 7860
11
  ---
12
  # This Oauth server is the code found at
13
+ github [modelcontextprotocol/python-sdk]( https://github.com/modelcontextprotocol/python-sdk/tree/main/examples/servers/simple-auth/mcp_simple_auth)
14
+ with changes made to run in a Huggingface Space as an simple free standing MCP Oauth Server.
15
 
16
  Check out [AuthO]( https://auth0.com/) for a next step.
17
 
 
20
  **To run this in your own HF Space**
21
  # Duplicate this space
22
  ## Add 3 secrets to the space
23
+ 1. AS_HOST_NAME ((embeded host name) eg applemuncy-as.hf.space)
24
  2. USER_NAME
25
  3. USER_PASSWORD
26
 
auth_server.py CHANGED
@@ -36,10 +36,10 @@ class AuthServerSettings(BaseModel):
36
  """Settings for the Authorization Server."""
37
 
38
  # Server settings
39
- host: str = F"{as_host_name}.hf.space"
40
  port: int = 7860
41
- server_url: AnyHttpUrl = AnyHttpUrl(F"https://{as_host_name}.hf.space")
42
- auth_callback_path: str = F"https://{as_host_name}.hf.space/login/callback"
43
 
44
 
45
  class SimpleAuthProvider(SimpleOAuthProvider):
@@ -175,7 +175,7 @@ def main(port: int) -> int:
175
  auth_settings = SimpleAuthSettings()
176
 
177
  # Create server settings
178
- host = F"{as_host_name}.hf.space"
179
  server_url = f"https://{host}" #:{port}"
180
  server_settings = AuthServerSettings(
181
  host=host,
 
36
  """Settings for the Authorization Server."""
37
 
38
  # Server settings
39
+ host: str = as_host_name
40
  port: int = 7860
41
+ server_url: AnyHttpUrl = AnyHttpUrl(as_host_name)
42
+ auth_callback_path: str = F"https://{as_host_name}/login/callback"
43
 
44
 
45
  class SimpleAuthProvider(SimpleOAuthProvider):
 
175
  auth_settings = SimpleAuthSettings()
176
 
177
  # Create server settings
178
+ host = as_host_name
179
  server_url = f"https://{host}" #:{port}"
180
  server_settings = AuthServerSettings(
181
  host=host,