Skip to content

Commit 9aafe25

Browse files
committed
use SMART App v2 scopes
1 parent 0eccf36 commit 9aafe25

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

server/index.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ let authToken: AuthorizationToken;
4242

4343
// auth flow: response with URL to redirect to Medicare.gov beneficiary login
4444
app.get("/api/authorize/authurl", (req: Request, res: Response) => {
45-
res.send(bb.generateAuthorizeUrl(authData));
45+
// for SMART App v2 scopes usage: explicitly
46+
// provide query parameter scope=<v2 scopes>
47+
// where <v2 scopes> is space delimited v2 scope specs (url encoded)
48+
// e.g. patient/ExplanationOfBenefit.rs
49+
const redirectUrl = bb.generateAuthorizeUrl(authData) + "&scope=patient%2FPatient.s%20patient%2FExplanationOfBenefit.rs"
50+
res.send(redirectUrl);
4651
});
4752

4853
// auth flow: oauth2 call back

0 commit comments

Comments
 (0)