Skip to content

Commit 46ae341

Browse files
committed
Check for flow type when issuing credentials
1 parent 759e689 commit 46ae341

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Controllers/VerifiableCredentials/CredentialIssuerCredentialController.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,17 @@ public function credential(Request $request): Response
100100
);
101101
}
102102

103+
if (
104+
($flowType = $accessToken->getFlowTypeEnum()) === null ||
105+
$flowType->isVciFlow() === false
106+
) {
107+
return $this->routes->newJsonErrorResponse(
108+
'invalid_token',
109+
'Access token is not intended for verifiable credential issuance.',
110+
401,
111+
);
112+
}
113+
103114
// TODO mivanci Validate credential request
104115

105116
$credentialFormatId = $requestData[ClaimsEnum::Format->value] ?? null;

0 commit comments

Comments
 (0)