verify PRM resource
This commit is contained in:
parent
e5b2a5b880
commit
4fcbb6870b
1 changed files with 3 additions and 0 deletions
|
|
@ -110,6 +110,9 @@ export async function auth(
|
|||
if (resourceMetadata.authorization_servers && resourceMetadata.authorization_servers.length > 0) {
|
||||
authorizationServerUrl = resourceMetadata.authorization_servers[0];
|
||||
}
|
||||
if (resourceMetadata.resource && resourceMetadata.resource !== resource.href) {
|
||||
throw new Error(`Protected resource ${resourceMetadata.resource} does not match expected ${resource}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn("Could not load OAuth Protected Resource metadata, falling back to /.well-known/oauth-authorization-server", error)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue