bugfix: Non-empty paths in OAuth2 Authorization Server Metadata URLs (#441)
* fix: support non-empty paths in OAuth2 Authorization Server Metadata URLs * fix: address formatting errors
This commit is contained in:
parent
f8a747eaca
commit
4ee2add899
1 changed files with 5 additions and 1 deletions
|
|
@ -209,7 +209,11 @@ impl AuthorizationManager {
|
|||
pub async fn discover_metadata(&self) -> Result<AuthorizationMetadata, AuthError> {
|
||||
// according to the specification, the metadata should be located at "/.well-known/oauth-authorization-server"
|
||||
let mut discovery_url = self.base_url.clone();
|
||||
discovery_url.set_path("/.well-known/oauth-authorization-server");
|
||||
let path = discovery_url.path();
|
||||
let path_suffix = if path == "/" { "" } else { path };
|
||||
discovery_url.set_path(&format!(
|
||||
"/.well-known/oauth-authorization-server{path_suffix}"
|
||||
));
|
||||
debug!("discovery url: {:?}", discovery_url);
|
||||
let response = self
|
||||
.http_client
|
||||
|
|
|
|||
Loading…
Reference in a new issue