Skip to content

Commit 038fecb

Browse files
committed
Fix onTokenRequest callback to use new interface
The createAuthServer onTokenRequest callback now passes an object with authorizationHeader, body, timestamp etc. instead of (req, timestamp). Also added missing return value for TokenRequestResult.
1 parent 3e67a97 commit 038fecb

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/scenarios/client/auth/token-endpoint-auth.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,8 @@ class TokenEndpointAuthScenario implements Scenario {
6464
const authApp = createAuthServer(this.checks, this.authServer.getUrl, {
6565
tokenVerifier,
6666
tokenEndpointAuthMethodsSupported: [this.expectedAuthMethod],
67-
onTokenRequest: (req, timestamp) => {
68-
const authorizationHeader = req.headers.authorization as
69-
| string
70-
| undefined;
71-
const bodyClientSecret = req.body.client_secret;
67+
onTokenRequest: ({ authorizationHeader, body, timestamp }) => {
68+
const bodyClientSecret = body.client_secret;
7269
const actualMethod = detectAuthMethod(
7370
authorizationHeader,
7471
bodyClientSecret
@@ -110,6 +107,11 @@ class TokenEndpointAuthScenario implements Scenario {
110107
...(formatError && { formatError })
111108
}
112109
});
110+
111+
return {
112+
token: `test-token-${Date.now()}`,
113+
scopes: []
114+
};
113115
},
114116
onRegistrationRequest: () => ({
115117
clientId: `test-client-${Date.now()}`,

0 commit comments

Comments
 (0)