fix: do not manually construct fallback authorization metadata (#507)
This commit is contained in:
parent
04e0590652
commit
d3ddc09e52
1 changed files with 3 additions and 23 deletions
|
|
@ -251,29 +251,9 @@ impl AuthorizationManager {
|
||||||
return Ok(metadata);
|
return Ok(metadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
warn!("No valid authorization metadata found, falling back to default endpoints");
|
// No valid authorization metadata found - return error instead of guessing
|
||||||
|
// OAuth endpoints must be discovered from the server, not constructed by the client
|
||||||
// fallback to default endpoints
|
Err(AuthError::NoAuthorizationSupport)
|
||||||
let mut auth_base = self.base_url.clone();
|
|
||||||
// discard the path part, only keep scheme, host, port
|
|
||||||
auth_base.set_path("");
|
|
||||||
|
|
||||||
// Helper function to create endpoint URL
|
|
||||||
let create_endpoint = |path: &str| -> String {
|
|
||||||
let mut url = auth_base.clone();
|
|
||||||
url.set_path(path);
|
|
||||||
url.to_string()
|
|
||||||
};
|
|
||||||
|
|
||||||
Ok(AuthorizationMetadata {
|
|
||||||
authorization_endpoint: create_endpoint("authorize"),
|
|
||||||
token_endpoint: create_endpoint("token"),
|
|
||||||
registration_endpoint: None,
|
|
||||||
issuer: None,
|
|
||||||
jwks_uri: None,
|
|
||||||
scopes_supported: None,
|
|
||||||
additional_fields: HashMap::new(),
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// get client id and credentials
|
/// get client id and credentials
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue