Skip to content

Commit 8339d18

Browse files
committed
Correctly construct aud for scope verification
(different from aud for jwt)
1 parent dde0a7d commit 8339d18

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pegasus/lib/xrpc.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,11 @@ let service_proxy ?lxm ?aud (ctx : context) =
209209
| None ->
210210
Errors.invalid_request "invalid proxy header"
211211
in
212-
let aud = Option.value aud ~default:(service_did ^ "#" ^ service_type) in
213-
let lxm = Option.value lxm ~default:nsid in
214-
Auth.assert_rpc_scope ctx.auth ~aud ~lxm ;
215212
let fragment = "#" ^ service_type in
213+
let aud = Option.value aud ~default:service_did in
214+
let lxm = Option.value lxm ~default:nsid in
215+
let rpc_aud = aud ^ fragment in
216+
Auth.assert_rpc_scope ctx.auth ~aud:rpc_aud ~lxm ;
216217
match%lwt Id_resolver.Did.resolve service_did with
217218
| Ok did_doc -> (
218219
let scheme, host =

0 commit comments

Comments
 (0)